|
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...
|
|
|
|
|
Show me how you declared SendMessage (hint: in VB6 you used Long for Window Handle. In VB.NET you need to use Integer)
|
|
|
|
|
Private Declare Function SendMessage Lib "User" (ByVal hWnd As <code>Long</code>, ByVal wMsg As Integer, ByVal wParam As Integer, ByVal lParam As Long) As Long
I changed it to ByVal hWnd As Long , it was originally integer from the msDN. But it still doesnt work.....
The msgbox doesnt fire,
result = SendMessage(pBAr, 1029, 0, 0)
MsgBox result
The VC client gets a com error at runtime (goes into the catch(com e) block) is:
sway.exe (KERNEL32.DLL): 0xC000008F: Float Inexact Result.
Desperate!
|
|
|
|
|
I did
Private Sub Command1_Click()
Timer1.Interval = 40
Form2.Show vbModal
End Sub
Private Sub Timer1_Timer()
Dim rc As Long
Dim opstr As String
opstr = "fff"
rc = TextOut(Form2.hdc, 6, 20, opstr, Len(opstr))
Timer1.Interval = 0
End Sub
and was trying to step into. After timer1.interval I expected the execution to g into the timer function, but it didnt and just showed the modal form instead.
But a msgbox in timer function does trigger so i know its going in there> But it totallly disregards the textout and i dont see anything on form2. Doesnt textout "force" write stuff to where you say to write?
Thanks,
ns
|
|
|
|
|
This should work:
Private Declare Function GetActiveWindow Lib "user32" () As Long
Private Declare Function GetWindowDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function TextOut Lib "gdi32" Alias "TextOutA" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal lpString As String, ByVal nCount As Long) As Long
Private Sub Command1_Click()
Dim str
str = "This should work"
TextOut GetWindowDC(GetActiveWindow), 50, 50, str, Len(str)
End Sub
HTH
Nick Parker
So like children pointers should be left to grown ups. - Norm Alomond
|
|
|
|