Hi,

i have written a programm in VC++ 6.0, in this i use a dll, which is created with VB 6.0. on my pc it runs well, but on other computers the class in the vb-dll isnt called. i have already installed the VB 6.0 Runtime Files on the test pc, but it didnt helped.

for testing i put in my VB-dll all out, only a simple messagebox, it doesnt appears so the error should be somewhere in VC++

i put some code where the dll-class is called, i hope some of you experts see something!

//=============================================================
RechnungPOPDlg.cpp:
//=============================================================
#include "xlsconvert.h"

void CRechnungPOPDlg::OnOK() 
{	
	CString speicherPOP, DateiOut2;

	_Class1 xlsVB;
	xlsVB.CreateDispatch( _T("XLSConvert.Class1") );				//Class1 is defined in VB- XLSConvert.dll

	...
	
	xlsVB.CreateXLS( DateiOut2, speicherPOP );
}

//=============================================================
xlsconvert.cpp:
//=============================================================
#include "xlsconvert.h"

void _Class1::CreateXLS(LPCTSTR datei, LPCTSTR daten)
{
	static BYTE parms[] =
		VTS_BSTR VTS_BSTR;
	InvokeHelper(0x60030000, DISPATCH_METHOD, VT_EMPTY, NULL, parms,
		 datei, daten);
}




//=============================================================
xlsconvert.h:
//=============================================================

// Von Klassen-Assistent automatisch erstellte IDispatch-Kapselungsklasse(n). 
/////////////////////////////////////////////////////////////////////////////
// Wrapper-Klasse _Class1 

class _Class1 : public COleDispatchDriver
{
public:
	_Class1() {}		// Ruft den Standardkonstruktor für COleDispatchDriver auf
	_Class1(LPDISPATCH pDispatch) : COleDispatchDriver(pDispatch) {}
	_Class1(const _Class1& dispatchSrc) : COleDispatchDriver(dispatchSrc) {}

// Attribute
public:

// Operationen
public:
	void CreateXLS(LPCTSTR datei, LPCTSTR daten);
};

A program that runs on the development computer but not on other computers normally indicates there are one or more missing DLLs on the computer that it don't run on. And that is usually because the program was compiled for debug, not release. Recompile both the application and DLL for release mode and retest to see if that fixes the problem.

You might also run the program depends.exe found in the compiler's bin directory. It will tell you what DLLs are needed to run the program.

Hi,

sry for the delay i did have some holiday.

I tried the depends.exe, it seems that my custom VB-dll isnt listened in the exe.

i tried to see on my vb-dll with the depends.exe what for dll are used, i copied them to the other PC, but it didnt helped.

Does it give you any kind of runtime error message, such as "dll can not be found" or something like that?

Does it give you any kind of runtime error message, such as "dll can not be found" or something like that?

no the programm runs without any messages to the end. the programm dont crash, it's seems like the function in the dll wouldnt be called

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.