|
My VB dll gets the handles from the calling VC app:
Then it sends a message to the VC control whose handle it received. This control is a lowly button. I am tryng to trigger its click handler of this button with my sendMessage:
SendMessage(parentHAndle, WM_COMMAND, 0, buttonHandle)
But so far I am not succeeding. Anything I shoud know about this that I'm missing? I send in the parent handle and the button handle.
Thanks,
ns
|
|
|
|
|
Maybe this[^] article will help you ??
Nick Parker
The goal of Computer Science is to build something that will last at least until we've finished building it. - Unknown
|
|
|
|
|
Thank you for the link.
Thanks,
ns
|
|
|
|
|
Anyone want to share their feelings on Infragistic's NetAdvantage Suite or ComponentOne's Suite of components? Any other components that you would recommend?
Stuff like:
- Prettier menus
- Calendar controls (like Outlook, not like Calendar pickers)
- Excel like Grid control
But really, any cool components apply.
|
|
|
|
|
I'm using the Wise installation system to distribute my app. Should I include VBRun60sp5.exe in the package (I have to find out if Wise will run it for me too!), or package the dll separately? (Not really a VB question but---HAs anyone used Wise that knows if it can run an exe thats packaged in it? )
Thanks,
ns
|
|
|
|
|
I could be wrong here as I have only distributed my applications with the Package and Deployment Wizard, but I am not sure that you would need to include the runtime environment to install and run an application itself.
Nick Parker
The goal of Computer Science is to build something that will last at least until we've finished building it. - Unknown
|
|
|
|
|
hi..
could u pls help in getting the code for checking whether an internet connection was setup or not in vb?
|
|
|
|
|
Try something like this, there are actually several ways to check for something like this, but they all differ slightly.
Private Const INTERNET_CONNECTION_CONFIGURED = &H40
Private Const INTERNET_CONNECTION_LAN = &H2
Private Const INTERNET_CONNECTION_MODEM = &H1
Private Const INTERNET_CONNECTION_OFFLINE = &H20
Private Const INTERNET_CONNECTION_PROXY = &H4
Private Const INTERNET_RAS_INSTALLED = &H10
Private Declare Function InternetGetConnectedState Lib "wininet.dll" (ByRef lpdwFlags As Long, ByVal dwReserved As Long) As Long
Private Sub Form_Load()
Dim Ret As Long
Me.AutoRedraw = True
'retrieve the connection status
InternetGetConnectedState Ret, 0&
'show the result
If (Ret And INTERNET_CONNECTION_CONFIGURED) = INTERNET_CONNECTION_CONFIGURED Then Me.Print "Local system has a valid connection to the Internet, but it may or may not be currently connected."
If (Ret And INTERNET_CONNECTION_LAN) = INTERNET_CONNECTION_LAN Then Me.Print "Local system uses a local area network to connect to the Internet."
If (Ret And INTERNET_CONNECTION_MODEM) = INTERNET_CONNECTION_MODEM Then Me.Print "Local system uses a modem to connect to the Internet."
If (Ret And INTERNET_CONNECTION_OFFLINE) = INTERNET_CONNECTION_OFFLINE Then Me.Print "Local system is in offline mode."
If (Ret And INTERNET_CONNECTION_PROXY) = INTERNET_CONNECTION_PROXY Then Me.Print "Local system uses a proxy server to connect to the Internet."
If (Ret And INTERNET_RAS_INSTALLED) = INTERNET_RAS_INSTALLED Then Me.Print "Local system has RAS installed."
End Sub
Nick Parker
The goal of Computer Science is to build something that will last at least until we've finished building it. - Unknown
|
|
|
|
|
Hi everybody
Please I need help
I have problem to print Vb6. Datareport file contain more than 3 pages with Continuos paper after the page no 3 the printable area not starting in the correct position it displace about 2 cm in every page.
My report its Material List about 10 pages I tried to adjust top margin and bottom margin but the problem it continuing.
Thanks in advance.
Salem Ali
Sh_ln@hotmail.com
|
|
|
|
|
Post some of the code you are having a problem with.
Nick Parker
The goal of Computer Science is to build something that will last at least until we've finished building it. - Unknown
|
|
|
|
|
I'm trying to change the backcolour of a label on an inactive form. I would appreciate any help, this is my line of code:
frmBinarytoDecimal(lblTopText).BackColor = vbBlue
the frmBinarytoDecimal is my inactive form and the lblTopText is my label's name.
Sas
|
|
|
|
|
You need to use the . (i.e. - dot) operator to access the objects within a form. This will set the color:
frmBinarytoDecimal.lblTopText.BackColor = vbBlue
Nick Parker
The goal of Computer Science is to build something that will last at least until we've finished building it. - Unknown
|
|
|
|
|
|
|
I want red rectangles but am getting white ones:
Form1.FillStyle = vbFSSolid
Form1.FillColor = vbRed
For i = 0 To 100
RetVal = Rectangle(GetWindowDC(GetActiveWindow), 20 + 10 * i, 40, 30 + 10 * i, 50)
Next
Help!
Thanks,
ns
|
|
|
|
|
Try using something like this, I believe it will go one pixel at a time.
Declare Function FloodFill Lib "gdi32" Alias "FloodFill" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal crColor As Long) As Long
FloodFill Me.hdc, x, y, vbRed
Nick Parker
So like children pointers should be left to grown ups. - Norm Alomond
|
|
|
|
|
I have:
For i = 0 To 100
'TextOut GetWindowDC(GetActiveWindow), 50 + 10 * i, 50, str, Len(str)
RetVal = Rectangle(GetWindowDC(GetActiveWindow), 20 + 10 * i, 40, 30 + 10 * i, 50)
' ProgressBar1.Value = i
Next
on a modal form. Works ok. But, if you cover the running app with another screen and then show the app again, the rectangles have vanished!
I tried
' Form1.AutoRedraw = True , but this makes the form come up with no rectangles, and when you close the app, task manager says its still running. (I call that a 'crash' I dont know what that situation is called'.
Thanks,
ns
|
|
|
|
|
If you add your code to the subroutine Form_Paint() I think you should be able to see your rectangles when redisplaying your form. This worked for me.
Private Sub Form_Paint()
For i = 0 To 100
'TextOut GetWindowDC(GetActiveWindow), 50 + 10 * i, 50, str, Len(str)
RetVal = Rectangle(GetWindowDC(GetActiveWindow), 20 + 10 * i, 40, 30 + 10 * i, 50)
'ProgressBar1.Value = i
Next
End Sub
Nick Parker
So like children pointers should be left to grown ups. - Norm Alomond
|
|
|
|
|
Hi,
I've created a VB.NET application. I want that all exception generate an eventlog entry. I want also a specific eventlog so that it would be faster to find errors in logs.
I've written the code below. When running, all is ok (no error) but when I launch the eventlog console to have a look, I can see my eventlog but there is not entry in it.
<br />
' Create the source, if it does not already exist.<br />
If Not EventLog.SourceExists("OrthoDLL") Then<br />
Console.WriteLine(EventLog.LogNameFromSourceName("OrthoDLL", "."))<br />
EventLog.CreateEventSource("OrthoDLL", "Sybux")<br />
Console.WriteLine("CreatingEventSource")<br />
Console.WriteLine(EventLog.LogNameFromSourceName("OrthoDLL", "."))<br />
End If<br />
<br />
Dim myLog As New EventLog()<br />
<br />
myLog.Source = "OrthoDLL"<br />
<br />
' Write an informational entry to the event log. <br />
myLog.WriteEntry("Writing to event log.")<br />
thx for help
|
|
|
|
|
how do you set up shared memory in VB? How is this written to and read from. ARe the changes communicated instantaneously? I need some links or sample code showing this process.
|
|
|
|
|
Here[^] is a link on how to do this in VC6, do you have to do this in VB?
Nick Parker
So like children pointers should be left to grown ups. - Norm Alomond
|
|
|
|
|
Both - its a VB dll sending info to a VC client. HAd trouble with getting senmessage etc to work.
Thanks,
ns
|
|
|
|
|
Perhaps knowning exactly what you want to "share" would help out more. Depending on the kind of data and its nature, there may be one or more solutions to your problem.
- (i think i swallowed a bug)
"there's more to life than skiing, when you find it let me know"
|
|
|
|
|
I have written an MFC ActiveX control in VC++7 and am testing it in Excel 2000.
For some reason Excel will not recognize any methods of the control that were
added to the control after the very first time I used it in Excel. Even in a completely new spreadsheet. The new methods show in the object browser of Excel/vba but generate a "runtime error 438 (Object doesn't support this property or method)" error when called in the vba code.
I've tried unregistering the control, removing it physically, removing references to it but all to no avail.
If I try all of the above in Access 2000 using VBA it works fine.
Is this an Excel bug of some kind or...?
|
|
|
|
|
The VB dll has in a function:
result = SendMessage(PbarHandle, 1026, 5, 0)
The VC client sends in the handle of a progressbar. I verfied that handle sent in is being received by the VB dll. However if I put a msgBox right after the SendMessage , it doesnt fire. In the VC client, at the call to the dll, a com error happens:
void CMswayView::OnButton2()
{
try
{
CoInitialize(NULL);
_Class1Ptr ptr;
ptr.CreateInstance(__uuidof(Class1));
m_Progress1.SetStep(1);
m_Progress1.SetRange(1, 10);
long lHwnd=(long)m_Progress1.GetSafeHwnd();
ptr->CheckingStuff(&lHwnd);
}
catch(_com_error &e)
{
bstrDesc = e.Description();
}
CoUninitialize();
}
But we know the error is happening in the VB dll since the we cant get past the sendmessage, and the very next line: msgbox doesnt fire.
How can I figure out what is happening? Why is sendmessage not working? Is it that I've done something dumb in sending in the handle and its not valid anymore or something?
I have a #import in my VC client for the VB dll.
Thanks,
ns
1026 is just setting the position. Not even 1029 (PBM_STEPIT) works. Somethigs fundamentally flawed in my assumptions here...
|
|
|
|