Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

references

Status
Not open for further replies.

SuryaF

Programmer
May 21, 2006
100
DE
Well, I have a mind-twisting problem.

My application runs as an MDE.
I need to use some libraries that are only installed on some of the computers (quickbooks dll's, FYI).

If I create the reference from the get-go, the application doesn't work on the computers that do not have the libraries (missing references).

If I remove the reference and add the libraries at runtime, I can't create the MDE (the data types are not recognized so it doesn't compile).

Does anyone have any idea on how to get around this?
Thanks a bunch!
 
Use late binding instead of early binding.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
You can create a batch file that looks for the files needed and if they're not there, installs and registers them. Run the batch file prior to the program install.

If it's a quickbooks dll then it's probably in a directory that does not exist either and you probably reference it in that folder. if so, I would create a folder for your program and dll's, copy not move them to that folder, and reference the files from there so the references hold. (I'm not sure if registering a dll makes a reference work if the dll is in a different folder from where it was registered)

To create a batch file. Open notepad and name your file SomeName.bat and save it.then put in something like this.
Code:
If not exist C:\NewProgramFolder mkdir c:\NewProgramFolder

If Exist C:\NewProgramFolder Copy *.* c:\NewProgramFolder

CD C:\NewProgramFolder

Regsvr32 *.dll /i
and run it to see if it works. You may have to play with it a bit, I'm rusty at DOS batch files.
 
Thanks PH for pointing me in the right direction. That's exactly what I needed.

I don't think it's a matter of registering the dll in my case, CaptainD, thanks for your response though.

All the best!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top