Forum How do I...?

ActiveX Control

Ben
Maybe this is a better topic for a VB forum, but I think the answer is relatively simple...
I'm a VB newbie, trying to get the Prince ActiveX DLL working for me. I've built a project, the forum runs great and all I need to be able to do now is incorporate the DLL into the code. How do I do this so that when I compile the installer in Visual Studio, the DLL will come packaged with the executable that I am building?
In other words, is there a way to import the dll into my project (without going into regserver myself and adding it).
Thanks for any help.
Ben
Cong
Hi Ben,

The Prince ActiveX control file Prince.dll needs to be registered in the system registry before it can be used in your VB project. Once it's registered, it is available to your VB and you can see it in the Project References as "Prince ActiveX Dll 5.0".

When you package your VB project in Visual Studio for installation on client computers, check and make sure the Prince.dll is included in the Dependence File list before you build the setup.exe file. Once this is done, the Prince.dll will be bundled in your VB package and will be automatically registered when you run setup.exe to install your VB project on client computers. Hope this helps.

Cong
Ben
Thank you very, very much Cong. Your comments have always been very helpful to me. I am wondering, is there anywhere that has an example of the Prince.DLL being loaded, setting the path for Prince, and allowing for an error message to be displayed if the path used in the SetPath function is invalid or incorrect?
I can get Prince to load in my Visual Basic application, but am having problems using the statement
Dim WithEvents pr As Prince
VB yells at me for using "WithEvents." I am just looking to be able to provide a message box to the user in the case that the string used in the SetPath function is not valid.
Part of the reason for finding this out is also because I'm getting a 0 returned in the Convert statement and I'm not sure why. Everything seems to be loading properly...
Cong
You are welcome Ben :)

In the case of an invalid Prince path passed to the SetPrincePath function, the Prince Com interface will display an error message and the Convert function will fail and return 0.

You mentioned that VB complains when you use the statement:

Dim WithEvents pr As Prince

Is it possible to paste the VB error message here so we can give the problem a bit more investigation.

Thanks

Cong