how to launch form in a vb COM dll
-
Its necessary for me to launch a form in my COM VB dll. So far all I have in it is a class, and a bas module.Launching the form can be the first thing the dll does - it will be a progressbar indicating the progress of my dlls called function. Then I want to make it vanish when the dll is done with its job. Please help! Thanks, ns
-
Its necessary for me to launch a form in my COM VB dll. So far all I have in it is a class, and a bas module.Launching the form can be the first thing the dll does - it will be a progressbar indicating the progress of my dlls called function. Then I want to make it vanish when the dll is done with its job. Please help! Thanks, ns
I guess I am not sure where you are stuck. Nick Parker
If the automobile had followed the same development as the computer, a Rolls-Royce would today cost $100, get a million miles per gallon, and explode once a year killing everyone inside. -Robert Cringely
-
I guess I am not sure where you are stuck. Nick Parker
If the automobile had followed the same development as the computer, a Rolls-Royce would today cost $100, get a million miles per gallon, and explode once a year killing everyone inside. -Robert Cringely
Well, I have a VB class, whose function I call from another app(a VC app). This VB class is in an ActiveX dll. The function does so non gui stuff. The first thing I want to popup when this gfunction runs is a little form with a progressbar, and my Vb function will satrt it off at zero, then as the function progresses, this info is communivcted to the form which advances the progress bar. when the function is done, it notifies the form , which should vanish. SO how exactly does one implement this? The only VB i've done is where you set the form as the stratup object in a standard exe. So I dont know in this dll, do I say, in the class function: (Big guessing here - not familkiar with VB) Public function myFunction Form1.show 'form1 has the progressbar on it. form1.ProgressBar.Position = 0; 'Now get the execution to continue in the class function somehow (how? ARe we still in the class'es code? 'Class function does stuff: 'Job A finishes. Notify progressbar to advance to 30% Resume with Job2 in class function. Job B finishes. Notify progressbar to advance to 60% etc etc If you can give me a little sample code for a sample function that can do the above I would be very grateful. Thanks, ns Thanks, ns
-
I guess I am not sure where you are stuck. Nick Parker
If the automobile had followed the same development as the computer, a Rolls-Royce would today cost $100, get a million miles per gallon, and explode once a year killing everyone inside. -Robert Cringely
I just tried this in a function in my VB dll class:
Public Function CheckingStuff() MsgBox "a" Form1.Show MsgBox "just showed form1" For i = 0 To 100 i = i + 1 Next Form1.Text1.Text = "didstuff" End Function
and called it from VC with:
CoInitialize(NULL); _Class1Ptr ptr; ptr.CreateInstance(__uuidof(Class1)); ptr->CheckingStuff();
The first msgbox fires, but then no form shows and the second msgbox never fires.......... Help! Thanks, ns
-
I just tried this in a function in my VB dll class:
Public Function CheckingStuff() MsgBox "a" Form1.Show MsgBox "just showed form1" For i = 0 To 100 i = i + 1 Next Form1.Text1.Text = "didstuff" End Function
and called it from VC with:
CoInitialize(NULL); _Class1Ptr ptr; ptr.CreateInstance(__uuidof(Class1)); ptr->CheckingStuff();
The first msgbox fires, but then no form shows and the second msgbox never fires.......... Help! Thanks, ns
It had to be shown modally in the VC client (a limitation) and thats brought its own set of problems...my progressbar wont update in it until its dismissed and reshown. No tricks like unload and hide work. the form is modal so sits there. CAn I force it to somehow go away? Then reshow it with newly loaded info? Thanks, ns
-
Well, I have a VB class, whose function I call from another app(a VC app). This VB class is in an ActiveX dll. The function does so non gui stuff. The first thing I want to popup when this gfunction runs is a little form with a progressbar, and my Vb function will satrt it off at zero, then as the function progresses, this info is communivcted to the form which advances the progress bar. when the function is done, it notifies the form , which should vanish. SO how exactly does one implement this? The only VB i've done is where you set the form as the stratup object in a standard exe. So I dont know in this dll, do I say, in the class function: (Big guessing here - not familkiar with VB) Public function myFunction Form1.show 'form1 has the progressbar on it. form1.ProgressBar.Position = 0; 'Now get the execution to continue in the class function somehow (how? ARe we still in the class'es code? 'Class function does stuff: 'Job A finishes. Notify progressbar to advance to 30% Resume with Job2 in class function. Job B finishes. Notify progressbar to advance to 60% etc etc If you can give me a little sample code for a sample function that can do the above I would be very grateful. Thanks, ns Thanks, ns
I don't believe that you are going to be able to access your VC++ form from within the VB ActiveX.dll directly. The work around I believe is somewhat circular. Suppose you have a function called
UpdateVCScreen();
written in VC++ to update your progress bar. Now you have function calledDoVBStuff()
inside your VB ActiveX.dll, lets just say that your VB function opens a file and reads it line by line. You can call your VB function from VC++, however to update the progress bar in your VC++ application you are going to need to make a a call to your VC++UpdateVCScreen();
function from your VB ActiveX.dll that will interface to your application which you have written in VC++. There may be many other ways to do this, however I am not sure of another method. Does this make any sense? HTH Nick Parker
If the automobile had followed the same development as the computer, a Rolls-Royce would today cost $100, get a million miles per gallon, and explode once a year killing everyone inside. -Robert Cringely
-
I just tried this in a function in my VB dll class:
Public Function CheckingStuff() MsgBox "a" Form1.Show MsgBox "just showed form1" For i = 0 To 100 i = i + 1 Next Form1.Text1.Text = "didstuff" End Function
and called it from VC with:
CoInitialize(NULL); _Class1Ptr ptr; ptr.CreateInstance(__uuidof(Class1)); ptr->CheckingStuff();
The first msgbox fires, but then no form shows and the second msgbox never fires.......... Help! Thanks, ns
ns wrote: Form1.Show VC++ doesn't know you want your VC++ form to show,
form1.
when written within a VB app is inclusive to object bound within that project. Nick Parker
If the automobile had followed the same development as the computer, a Rolls-Royce would today cost $100, get a million miles per gallon, and explode once a year killing everyone inside. -Robert Cringely
-
I don't believe that you are going to be able to access your VC++ form from within the VB ActiveX.dll directly. The work around I believe is somewhat circular. Suppose you have a function called
UpdateVCScreen();
written in VC++ to update your progress bar. Now you have function calledDoVBStuff()
inside your VB ActiveX.dll, lets just say that your VB function opens a file and reads it line by line. You can call your VB function from VC++, however to update the progress bar in your VC++ application you are going to need to make a a call to your VC++UpdateVCScreen();
function from your VB ActiveX.dll that will interface to your application which you have written in VC++. There may be many other ways to do this, however I am not sure of another method. Does this make any sense? HTH Nick Parker
If the automobile had followed the same development as the computer, a Rolls-Royce would today cost $100, get a million miles per gallon, and explode once a year killing everyone inside. -Robert Cringely