| CString::AllocSysString() needs to be free'd? |
|
 |
Index ‹ Visual Studio ‹ Visual Studio C++
|
- Previous
- 1
- 2
- VB Scripts >> Remotable WSC not showing up in "dcomcnfg.exe" ?Hi there,
maybe someone could help me in this corner:
- I created a WSC (a COM component with the logic written in VBasic and ooRexx), which can be
instantiated locally *and* after some research and peeking and poking also remotely (one needs to
use the "remotable"-attribute and then configure the remote access via "dcomcnfg.exe"
- after enhancinge, changing, copying forward and backward, renamed the PROGID and the like; anyway,
locally everything has been working and humming along nicely, but now when trying to test the
remote-instantiation and remote access I need to configure the DCOM part for that WSC; unexplicably,
the WSC-component does not show up anymore? Tried a lot of things (including rebooting the machine a
couple of times just to be sure), but so far I could not come to a solution.
If there is anyone who could give any hints/ideas, I really would appreciate it.
TIA,
---rony
P.S.: Could it be that NTFS-access rights can have an influence on "dcomcnfg.exe" not being able to
find my WSC-component ? (To fight that, I allowed full access to "Everyone" on that particular
directory tree, but who knows?)
- 3
- Visual Basic [VB] >> Reading Excel into a dataset in VB.netI haven't been able to configure a data adapter with the
wizard for Excel (Access is no problem) and when I try to
do it in code I still have problems, can anyone help,
here is some code I've been experimenting with.
Sub test()
Dim DS As System.Data.DataSet
Dim MyCommand As
System.Data.OleDb.OleDbDataAdapter
Dim MyConnection As
System.Data.OleDb.OleDbConnection
Dim datagrid1 As DataGrid
MyConnection = New
System.Data.OleDb.OleDbConnection( _
"provider=Microsoft.Jet.OLEDB.4.0; " & _
"data source=C:\Documents and
Settings\default\My Documents\Payroll.XLS; " & _
"Extended Properties=Excel 8.0;")
MyCommand = New System.Data.OleDb.OleDbDataAdapter
( _
"select * from [Sheet4$]", MyConnection)
DS = New System.Data.DataSet
MyCommand.Fill(DS)
datagrid1.SetDataBinding(DS, "sheet4$")
MyConnection.Close()
End Sub
Your help is greatly appreciated, Nitromuse
- 4
- Visual Basic [VB] >> Changing Printer's default paperHi all,
I am trying to print a report in A4 paper, but my printer's default paper is
different (Letter 8.5 x 11 inches). So when i print, a significant part of
the paper remains blank, because of the different margins. Does anyone know
how to programmatically change the printer's default paper? Almost all
properties of the Printersettings Class on this matter are ReadOnly.
Thank u
Panos
- 5
- Visual Basic [VB] >> VB.NET Form DesignerI have VB.NET project with multiple forms. I can view and work woth all forms in the project in normal design mode on one machine but not on another. Both instances of Visual Studion are accessing thr same source code; both are 2003 version.
The project executes OK on both systems and I can see the code for all forms on both machines. But on one machine I get an "object reference not set to an instance of an object" message when I attempt to see the form's design/layout.
--
Al S
- 6
- Visual Basic [VB] >> How to display username of visitor to pageI would like to display the username of the visitor top a web page. This is
assuming that the visitor is coming from within a winodws2000 Domain. I
have tried the following but it gives me the user ASPNET which I assume is
coming from the IIS server not the web client :
Imports System.Security.Principal
'Returns current user
Public Function CurrentUser()
Dim pos As Integer, fullname As String
fullname = System.Security.Principal.WindowsIdentity.GetCurrent().Name
'Just to get at the username after the 'domainname\' Should really use
Substring instead of Mid
pos = InStr(fullname, "\", CompareMethod.Text)
CurrentUser =
Mid(System.Security.Principal.WindowsIdentity.GetCurrent().Name, pos + 1)
End Function
'To test whether user is a member of a group
Private Function InGroup(ByVal grp As String) As Boolean
Dim id As WindowsIdentity
id = WindowsIdentity.GetCurrent()
Dim p As New WindowsPrincipal(id)
InGroup = p.IsInRole("YourDomainName\" + grp)
End Function
....and a sample Sub Main()....
Sub Main()
dim msg as string
If InGroup("AppUsers") Then
Application.Run(New YourMainForm)
Else
msg = "You are not a registered user. Please go away."
MessageBox.Show(msg, "Invalid user", MessageBoxButtons.OK)
End If
End Sub
- 7
- MFC >> Resizing an applicationHello,
I want to put a limit on the minimum size that my application can be resized
to. Any ideas on how to implement this?
- 8
- Visual Basic >> container namehow do i get the container name and it's position in a control array? for
example, cmdNext.Container.Name will return "PageNumber", but i would like
to get the control "PageNumber"'s position in the array. i just want to
check and see that each field is filled on a wizard page before enable the
next button. i need to do this for a couple of pages, not all of them,
which is why i'd like to get the container's position in the array.
thanks,
lance
- 9
- 10
- VB Scripts >> MS Word TAB jumpingI'm making a vbs script that opens a .DOT word document, saves a .DOC
copy, and then modifies the .DOC's content.
The document contains several Text Form Fields. I want the script to
write a string in each of those Fields. How do I enumerate the fields
(jump from one field to the next)?
--
Regards,
Thomas M.
- 11
- Visual Studio C++ >> question on __based pointers (VC 7.1)This is a multi-part message in MIME format.
------=_NextPart_000_000D_01C4CB56.771AAF40
Content-Type: text/plain;
charset="koi8-r"
Content-Transfer-Encoding: quoted-printable
Hi,
I cannot understand compiler's logic when compiling the following code:
void test()
{
void *b;
char __based(b) *p;
long v;
//++ case 1=20
char *temp =3D (char*)p;
v =3D (long)temp;
//--
//++ case 2
v =3D (long)(char*)p;
//--
}
Why in case 1 l gets a value different than in case 2 ?
Here is corresponding excerpt from .asm file generated during =
compilation (optimization disabled):
_l$ =3D -16 ; size =3D 4
_b$ =3D -12 ; size =3D 4
_pc$ =3D -8 ; size =3D 4
_p$ =3D -4 ; size =3D 4
?test@@YAXXZ PROC NEAR ; test
; 2 : {
push ebp
mov ebp, esp
sub esp, 16 ; 00000010H
; 3 : void *b;
; 4 : char __based(b) *p;
; 5 : =20
; 6 : long v;
; 7 : =20
; 8 : //++ case 1=20
; 9 : char *temp =3D (char*)p;
mov eax, DWORD PTR _p$[ebp]
add eax, DWORD PTR _b$[ebp]
mov DWORD PTR _temp$[ebp], eax
; 10 : v =3D (long)temp;
mov ecx, DWORD PTR _temp$[ebp]
mov DWORD PTR _v$[ebp], ecx
; 11 : //--
; 12 :=20
; 13 : //++ case 2
; 14 : v =3D (long)(char*)p;
mov edx, DWORD PTR _p$[ebp]
mov DWORD PTR _v$[ebp], edx
; 15 : //--
; 16 : } mov esp, ebp
pop ebp
ret 0
?test@@YAXXZ ENDP ; test
Thanks in advance.
---
Best regards
R. Green
------=_NextPart_000_000D_01C4CB56.771AAF40
Content-Type: text/html;
charset="koi8-r"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Dkoi8-r">
<META content=3D"MSHTML 6.00.2800.1400" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff background=3D"">
<DIV><FONT face=3DArial size=3D2>Hi,<BR><BR>I cannot understand =
compiler's logic=20
when compiling the following code:<BR><FONT face=3DCourier =
size=3D2><FONT=20
face=3DArial><FONT color=3D#0000ff size=3D2>
<P><FONT face=3D"Courier New">void</FONT></FONT><FONT size=3D2><FONT=20
face=3D"Courier New"> test()</FONT></P>
<P><FONT face=3D"Courier New">{</FONT></P>
<P></FONT><FONT face=3D"Courier New" color=3D#0000ff =
size=3D2>void</FONT><FONT=20
size=3D2><FONT face=3D"Courier New"> *b;</FONT></P>
<P></FONT><FONT face=3D"Courier New"><FONT color=3D#0000ff =
size=3D2>char</FONT><FONT=20
size=3D2> </FONT><FONT color=3D#0000ff =
size=3D2>__based</FONT></FONT><FONT=20
size=3D2><FONT face=3D"Courier New">(b) *p;</FONT></P>
<P><FONT face=3D"Courier New"></FONT></P>
<P></FONT><FONT face=3D"Courier New" color=3D#0000ff =
size=3D2>long</FONT><FONT=20
size=3D2><FONT face=3D"Courier New"> v;</FONT></P>
<P><FONT face=3D"Courier New"></FONT></P>
<P></FONT><FONT color=3D#008000 size=3D2><FONT face=3D"Courier New">//++ =
case 1=20
</FONT></P></FONT><FONT size=3D2>
<P></FONT><FONT face=3D"Courier New"><FONT color=3D#0000ff =
size=3D2>char</FONT><FONT=20
size=3D2> *temp =3D (</FONT><FONT color=3D#0000ff =
size=3D2>char</FONT></FONT><FONT=20
size=3D2><FONT face=3D"Courier New">*)p;</FONT></P>
<P><FONT face=3D"Courier New">v =3D (</FONT></FONT><FONT face=3D"Courier =
New"=20
color=3D#0000ff size=3D2>long</FONT><FONT size=3D2><FONT=20
face=3D"Courier New">)temp;</FONT></P>
<P></FONT><FONT color=3D#008000 size=3D2><FONT=20
face=3D"Courier New">//--</FONT></P></FONT><FONT size=3D2>
<P></FONT><FONT color=3D#008000 size=3D2><FONT face=3D"Courier New">//++ =
case=20
2</FONT></P></FONT><FONT size=3D2>
<P><FONT face=3D"Courier New">v =3D (</FONT></FONT><FONT face=3D"Courier =
New"><FONT=20
color=3D#0000ff size=3D2>long</FONT><FONT size=3D2>)(</FONT><FONT =
color=3D#0000ff=20
size=3D2>char</FONT></FONT><FONT size=3D2><FONT face=3D"Courier =
New">*)p;</FONT></P>
<P></FONT><FONT color=3D#008000 size=3D2><FONT=20
face=3D"Courier New">//--</FONT></P></FONT><FONT size=3D2>
<P><FONT face=3D"Courier New">}</FONT></P>
<P> </P></FONT></FONT></FONT>
<P><FONT face=3DCourier size=3D2><FONT face=3DArial><STRONG>Why in case =
1 <FONT=20
face=3DCourier>l</FONT> gets a value different than in case 2=20
?</STRONG></FONT></FONT></P>
<P><FONT face=3DCourier size=3D2> </P></FONT></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><FONT color=3D#0000ff size=3D2><FONT =
face=3DCourier><FONT=20
size=3D2>
<P></FONT></FONT></FONT>Here is corresponding excerpt from .asm file =
generated=20
during compilation (optimization disabled):<BR><BR><BR><FONT =
face=3DCourier>_l$ =3D=20
-16 ; size =3D 4<BR>_b$ =3D=20
-12 ; size =3D 4<BR>_pc$ =3D=20
-8 ; size =3D 4<BR>_p$ =3D=20
-4 ; size =3D 4<BR>?test@@YAXXZ PROC=20
NEAR ; test<BR><BR></FONT></P>
<P><FONT face=3DCourier>; 2 : {</FONT></P>
<P><FONT face=3DCourier> push ebp<BR> mov ebp,=20
esp<BR> sub esp, 16 ;=20
00000010H</FONT></P>
<P><FONT face=3DCourier>; 3 : void *b;<BR>;=20
4 : char __based(b) *p;<BR>; 5 =
:=20
<BR>; 6 : long v;<BR>; 7 =
:=20
<BR>; 8 : //++ case 1 <BR>; =
9 :=20
char *temp =3D (char*)p;</FONT></P>
<P><FONT face=3DCourier> mov eax, DWORD PTR=20
_p$[ebp]<BR> add eax, DWORD PTR =
_b$[ebp]<BR> mov DWORD PTR=20
_temp$[ebp], eax</FONT></P>
<P><FONT face=3DCourier>; 10 : v =3D =
(long)temp;</FONT></P>
<P><FONT face=3DCourier> mov ecx, DWORD PTR=20
_temp$[ebp]<BR> mov DWORD PTR _v$[ebp], ecx</FONT></P>
<P><FONT face=3DCourier>; 11 : //--<BR>; =
12 : <BR>;=20
13 : //++ case 2<BR>; 14 : v =3D=20
(long)(char*)p;</FONT></P>
<P><FONT face=3DCourier> mov edx, DWORD PTR=20
_p$[ebp]<BR> mov DWORD PTR _v$[ebp], edx</FONT></P>
<P><FONT face=3DCourier>; 15 : //--<BR>; =
16 :=20
} mov esp, ebp<BR> pop ebp<BR> ret 0<BR>?test@@YAXXZ=20
ENDP ; test</FONT></P>
<P><FONT face=3DCourier></FONT> </P>
<P><STRONG></STRONG> </P>
<P><STRONG></STRONG> </P>
<P><STRONG>Thanks in advance.</STRONG></P>
<P>---</P>
<P> </P>
<P>Best regards</P>
<P> </P>
<P>R. Green</P>
<P> </P>
<P><FONT face=3DCourier></FONT></FONT> </P></DIV></BODY></HTML>
------=_NextPart_000_000D_01C4CB56.771AAF40--
- 12
- Visual Basic >> Error 70-Permission Denied accessing mdb file on Vista ComputerThe whole story.
I just upgraded from VB4 to VB5 on my Windows XP
computer with 500megs of RAM. When I run the VB5 Application setup Wizard
to create my distribution file (of a program that has run for years in VB4),
several unusal things happen.
First, in the first step of the wizard, if I check "Rebuild the Project" the
system hangs up until I go into task manager and stop the VB5 Wizard.
Second, the Wizard lists 4 files with no dependencies(urlmon.dll,
comdlg32.ocx, comctl32.ocx and shdocvw.dll) which I ignored.
Third, the Wizard notifies me that a dependency file for Crystl32.ocx is out
of date, which I ignored.
The Application setup then completes with my distribution File(program).
When I load my distribution file(executable program) onto a Vista Computer
with 2Gigs of memory, I get a message "an error occurred while registering
the file C\ProgramFile\Microsoft Shared\DAO\DAO350.dll" (which I ignored). I
also get the same message for the Shadocvw.dll ( which I ignored). Setup
then completes.
Now comes the problem. When I try to run my application on this Vista
computer, at the point that my program tries to open one of my data
files(microsoft Access .mdb files) I get "Runtime Error 70 - Permission
denied".
I tried changing the security settings on the folders and files to no avail.
My guess is that since the DAO350.dll did not register, this might be the
cause of my problem, but I don't know what to do about it.
The only thing I see suspicious is in checking the VB5Dep.ini file, the
Register=$(dllSelfRegister) line for the DAO350.dll is in line number 5;
instead of line number 1 as for the DAO3032.dll in VB4.
Now, I would like your verdict!! Thanks for the help.
- 13
- MFC >> CScrollView questionI have created a window derived from CScrollView. When the logical view is
larger then the display view, I get both horiz and vert scroll bars. The
scrolling works fine with the scroll bars.
I want to programatically controll the scrolling so how can I make the
scroll bars disappear and still have the scrolling functionality?
In other words, I want to access to the scroll bars in CScrollView and hide
them with ShowWindow(SW_HIDE), and then still be able to scroll by sending
scroll messages programatically. Is this possible?
Thanks in advance.
Aeshkar
- 14
- Visual Basic [VB] >> Another Printing QuestionHi,
I am currently testing the printing features of Visual Studio 2005 (VB.NET)
We want to release a database application that prints label pages. The
labels must contain a picture box.
I found this code to print an image:
e.Graphics.DrawImage(Image.FromFile("c:\\dev\\Projects\\Impression\\merci.png"),
20, 750)
With this code, the picture will print with its original dimensions. Is it
possible to change this line with a picturebox or any control that allows us
to resize the image (and keep its proportions) within a limited space?
Thanks in advance!
ANNE DEBLOIS
- 15
- VB Scripts >> Eventlogs Related QuestionMoved here from inetsdk.programming.scripting.vbscript
upon the suggestion of Bob Barrows.
-----
A rather odd set of eventlog questions:
This isn't limited directly to *servers* but is applicable to
them. As I'm certain most of you know, you can create your own
personal "eventlog" and then write your error messages to it.
(The means to do so is clearly outlined on the MS scripting
site.)
Unfortunately, beyond those two steps there is lot that is
left to the imagination not only with regard to the personal
eventlog but also to the normal OS eventlogs. For example:
When one creates an eventlog, how can be certain that it was
successfully created? Assuming that you were successful in
creating the eventlog how can you later check to determine
whether it exists or not? (This question could also apply to
any/all of the usual OS eventlogs as well. [You wouldn't
want to write unless it existed.])
When you try to write a message to/into the/any eventlog, how
can you be certain that the attempt was successful? (Again
this could also be said for the standard OS eventlogs as
well.) [If the attempt failed you might want to write a
failure message into one of the OS eventlogs.]
I suspect that the standard answer will be "by clearing and
then checking the value of *error*" which makes sense, but
of course requires some knowledge of what you're looking
for in advance, which I don't, and which has resulted in
this post.
Does anyone out there have any experience that might be
able to elucidate/illuminate what I might be looking for?
Many thanks in advance.
David
|
| Author |
Message |
travhale

|
Visual Studio C++ >> CString::AllocSysString() needs to be free'd?
Hello!
I'm using VC++ 7.0 (.net 2002) and MFC.
I have a function (foo) that uses a CString variable (strCommand) as a
parameter. foo is accessing a database via ADO. Among the code is this:
pCommand->put_CommandText(strCommand.AllocSysString());
Do I need to free the memory allocated to string or will it do so
automatically?
// Anders
Crossposted to: microsoft.public.dotnet.languages.vc,microsoft.public.vc.language,microsoft.public.vc.mfc
Replies will go to: microsoft.public.dotnet.languages.vc
Visual Studio216
|
| |
|
| |
 |
| |
 |
Index ‹ Visual Studio ‹ Visual Studio C++ |
- Next
- 1
- Visual Basic >> Rename files (remove last few random numbers)Hey everyone I've got a small problem with one of my codes that I can't
figure out how to get around. When I save files from my program it
outputs a name like ******_***_##.ps My problem is the ## is a counter
number generated by the program when it saves the file. What I?m trying
to do is remove this number and its preceding underscore. Below is the
code that I?m currently using. At the present time the code works
great, however, the counter number will soon reach 100, which is 3
digits. Right now the program counts back from the end and is set for 2
digits. I need the program to take this random number off the end
regardless of whether the counter is at 1 or 9999, which is the range of
the counter. The file names vary in length so I cannot count from the
front side of the filename either. The code needs to simply remove
everything from the second underscore on and then put the .ps back on
the end. If you could help me with this I would really appreciate it.
Thanks for your time.
Private Sub Command1_Click()
Dim MyName As String
Dim Temp As String
Dim MyDir As String
MyDir = "c:\temp"
NewDir = "c:\temp2"
Temp = Dir$(MyDir & "*.ps")
Do While Temp <> ""
MyName = Left$(Temp, Len(Temp) - 6)
Name MyDir & Temp As NewDir & MyName & Right$(Temp, 3)
Temp = Dir$()
Loop
msg = "It's done"
MsgBox (msg)
Unload Form1
End Sub
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
- 2
- Visual Basic [VB] >> Mobile Selection List and DatabindingI have the following code:
Dim dv As New DataView(ds.Tables(1), "AnswerSetID = " & drQue _
("AnswerSetID"), "AnswerID",
DataViewRowState.OriginalRows)
sel.DataTextField = "AnswerText"
sel.DataValueField = "AnswerID"
sel.DataSource = dv
When this code renders the html. The DataValueField is ignored. Instead it
populates the value for the options with 0,1,2... and so on.
What am i missing to get the data value to be the contents of the
DataValueField?
- 3
- Visual Basic [VB] >> Problem parsing dates in .xsdI created an OleDbDataAdapter with the wizard in Visual Studio 2003.
It created a dataset, connectionstring etc. for me to work with. It
also created a .xsd file where one of the columns type is set to date.
My program is being used in many different countries, and many
different local settings. Some time ago a user from Turkey contacted
me saying my program crashed on his system with the following error
code:
System.ArgumentException: The string was not recognized as a valid
DateTime. There is a unknown word starting at index 0.Couldn't store
<Ekim 2006> in Date By Month Column. Expected type is DateTime.
I checked and double checked my code, but couldn't find what was
causing this error. I installed my program on a Turkish friend's
computer and it ran just fine. As a final effort, I changed the
columns type from date to string, handled the parsing of dates myself
in code, and the error was gone.
Could someone please explain why the parsing in my code works, but not
in the .xsd file? And what is the preferred method to use here. I'm
feeling a bit reluctant in changing code that works just fine for 99%
of my users to accomodate just this one.
- 4
- MFC >> what am i looking for?Hi. I am working on an MDI application and I am having problems looking for
information. I know what I want, I just dont know exactly what it is
called. When you start an MDI application and build and run it you get a
single document window in the main window. This is right, but I want a bar
docked to the left side of the main window that has a CTreeView control,
much like the folders bar that the Windows explorer has. I started looking
into the CSplitterWnd class which made the left tree like I wanted, but the
right frame looks like I cannot have multiple child windows in it anymore.
The ControlBar looks promising, but I'm not sure how to set it up. Would I
want a DialogBar in it, and if so, would I need a CTreeCtrl instead of
CTreeView? I have done several dialog based mfc applications before, but
SDI/MDI is new to me. Any help is appreciated. Thanx.
jorj
- 5
- 6
- Visual Basic [VB] >> Saving settingsHi,
is it possible to access the properties of a class or structure in a for
each statement?
I want to iterate through the stirng properties in my class or structure and
then write them away to the config file.
thanks for your help in advance
--
--
TimB
- 7
- MFC >> NetUserSetInfo() HomepathChecked w/VS 6.0 SP6 & .Net & .Net 2003
With NetUserSetInfo() when I set Home Folder Connect, the function works
fine. When I check it from the user manager, the home folder connect letter
and path is also seen. But when the user logs it's does not connect to home
folder. However if I click the edit field and <APPLY> from Windows User
Manager the next logon it connects home folder. Windows 2000 doesn't give any
message but in WServer 2003 prompts a dialog already....
Is it a program mistake or < Windows XP & SP2, Windows 2000, Windows Server
2003 > problem.
ui.usri1053_home_dir_drive = L"U";
ur.usri1006_home_dir = m_homepath;
nStatus = NetUserSetInfo(NULL, m_lpuser, dwLevel, (LPBYTE)&ui, NULL);
NetUserSetInfo(NULL, m_lpuser, dwLevel1, (LPBYTE)&ur, NULL);
- 8
- Visual Basic [VB] >> Make background of graphics object transparent.I keep getting my string inside a black box with this code.
I would like to make the background transparent. Any help on this will
be appreciated very much.
'**** BEGIN CODE ****
Try
Dim NewFont As New Font(fg.Font.FontFamily, 10, FontStyle.Regular)
Dim g As Graphics
Dim pic As Bitmap = New Bitmap(20, 20,
imaging.PixelFormat.Format24bppRgb)
g = Graphics.FromImage(pic)
g.Clear(Color.Transparent)
g.DrawString("H", NewFont, Brushes.Blue, 0, 0)
Dim st As New System.IO.MemoryStream
pic.Save(st, System.Drawing.Imaging.ImageFormat.Bmp)
Dim img As Image = Image.FromStream(st)
pct.Image = img
Catch exc As Exception
Stop
End Try
'**** END CODE ****
Kalvin
- 9
- 10
- Visual Basic [VB] >> Trying to create a colour reference formI'm trying to create many squares on a form and for every new square, change
the background colour to the next colour. I'm trying to create a colour
palette showing all available colours and their colour name.
My problem is that I can not figger out how to create a new panel at
specific intervals across and down the form. Here's the code I have so far:
Private Sub Form1_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim xNum As Byte = 4
Dim yNum As Byte = 2
Dim xLoc As Integer = 10
Dim yLoc As Integer = 10
Dim Spacer As Integer = 10
Dim ColourIndex As Object
Dim PanelHeight As Integer = 50
For y As Byte = 1 To yNum
For x As Byte = 1 To xNum
Dim NewPanelObj As New Panel
With NewPanelObj
.Left = xLoc
.Top = yLoc
.BackColor = CType(ColourIndex, Color)
xLoc += .Width + Spacer
End With
Next
yLoc += PanelHeight + Spacer
Next
End Sub
Can someone help me?
--
|
+-- Thief_
|
- 11
- Visual Basic [VB] >> Importing Excel into Access with VBI need some code ideas to import Excel into Access using
VB. I need to use VB because the Excel column formats are
not always consistent.
I'm importing a fairly simple spreadsheet.
Any assistance would be greatly appreciated.
- 12
- Visual Basic [VB] >> Problem in developing newsreader in vb.netHello,
I am developing a Newsreader in vb.net and i am
getting a problem in posting article to newserver
for a particular set of newsgroups. i developin g
this newsreader using nntp commands.I need
vb.net code for posting a article . I getting a
problem in defining a article format.
Kindly , Send me code for posting article in vb.net
using nntp command "post".
with regards,
balu.
- 13
- VB Scripts >> Use AutoItX? maybe AutXtra then?I moderate http://groups.yahoo.com/group/AutoItList/ and I have
created AutXtra.exe http://groups.yahoo.com/group/AutoItList/files/UTIL/AutXtra2.zip
There are 60 odd functions in AutXtra.exe and they can be accessed via
WSH this way...(examples...assume AutXtra.exe is at c:\)
example1:
Set oAutoIt = CreateObject("AutoItX.Control")
Set WshShell = WScript.CreateObject("WScript.Shell")
Set objEnv = WshShell.Environment("process")
objEnv("autxtra") = "cdlist"
Set oExec = WshShell.Exec("c:\autxtra.exe *clipboard")
Do While oExec.Status = 0
WScript.Sleep 50
Loop
WScript.Echo oAutoIt.ClipGet()
example2:
Set WshShell = WScript.CreateObject("WScript.Shell")
Set objEnv = WshShell.Environment("process")
objEnv("autxtra") = "cdopen"
objEnv("ax_drive") = "d:"
Set oExec = WshShell.Exec("c:\autxtra.exe *clipboard")
More Commands...
Commands:
-------------
Browse4Folder
CDClose
CDList
CDOpen
ChildClassList
DateAheadAgo
DiskSpace
DownLoad
DisableControl
EnableControl
FileDeleteLine
FileInsertLine
FileReplaceAll
FileReplaceLine
FindInFile (StringInFile)
FindPixel
FocusControl
Get8Dot3
GetComputerName
GetControlStats
GetCursor
GetFileSize
GetFileTime (GetFileDate)
GetLongFileName
GetPixelColor
HideControl
IsAdmin
LowerCase
MoveControl
MyIP
OpenDialog
Play
RemovableList
SaveDialog
ScreenSaverOff
ScreenSaverOn
SendToControl
SendToControlByClass
SetComputerName
ShortCut
ShowControl
StringAnsi2Oem
StringOem2Ansi
StringReplaceAll
StringReverse
TitleCase
UpdateEnv
UpperCase
WallPaper
WinBack
WinGetAllText (WinGetText)
WinGetStats
WinGetTextByClass
WinGetTitle
WinGetVisibleText
WinListAll
WinListVisible
WinNoTopMost
WinSetText
WinSetTextByClass
WinTopMost
--------------
- 14
- Visual Studio C++ >> Obtain PID'sI would like to know how to obtain a processe's owner from its pid
The sequence of
OpenProcess
OpenProcessToken
GetTokenInformation
LookupAccountSid
does not work on system processes.
This has been documented in MSDN as being casued by lack of
SE_DEBUG_NAME privelege. The KB article Q131065
describes how to enable this privelege in our process so that
OpenProcess does not fail on system processes
The said method works on all processes except system(pid 8) process
and CRSS process.
1)Why does this not work on these processes ?
2)Are there any other rights that have to be assigned to get this to work ?
3)Is there any other method that doesnt require these rights
to obtain the process owner name ?
Iam targeting NT 4.0 sp6 and above (2000 XP etc)
- 15
- Visual Basic >> Problem in Binary To Double Conversion in Win2000 which is working fine in WinXPHai,
I am trying to convert a binary value to double using the function
'pblfBinaryToDouble' given below. I am getting the result correctly in
Windows XP, but an 'Overflow Error' in Windows 2000. Can any one please help
me to solve this problem? What may be the issue, should I run any service
pack in Windows 2000 or something else?
The problem I am facing is in:
Microsoft Windows 2000
5.00.2195
Service Pack 4
Microsoft VisualBasic 6.0
Sample Output which I am getting in WindowsXP:
x = chr(0) & chr(0) & chr(182) & chr(69) & chr(102) &chr(102) & chr(6) &
chr(160)
?x
¶Eff
?pblfBinaryToDouble(x)
200409186961056
The functions used are given below.
Thanks & Regards,
Uma
Public Function pblfTwiddle(ByVal svInput As String) As String
Dim lngCount As Long
Dim svResult As String
svResult = ""
pblfTwiddle = svResult
For lngCount = Len(svInput) To 1 Step -1
svResult = svResult + Mid(svInput, lngCount, 1)
Next
pblfTwiddle = svResult
End Function
Public Function pblfBinaryToDouble(ByVal svBinaryValue As String) As Double
Dim lngLength As Long
Dim lngCount As Long
Dim svHex As String
Dim dblResult As Double
dblResult = 0#
pblfBinaryToDouble = dblResult
svBinaryValue = pblfTwiddle(svBinaryValue)
lngLength = Len(svBinaryValue)
svHex = "&H"
For lngCount = lngLength To 1 Step -1
svHex = svHex & IIf(Len(Hex(Asc(Mid(svBinaryValue, lngCount, 1)))) =
1, "0", "") & Hex(Asc(Mid(svBinaryValue, lngCount, 1)))
Next lngCount
dblResult = CDbl(svHex)
pblfBinaryToDouble = dblResult
End Function
|
|
|