GetRecordInfoFromGUID returns 0x80029C4A
-
Hi folks, I'm developing a DCOM Client/Server project under Win2000 SP4 (both client and server) with VC++ 6.0. An object in this project has to interface with National Instruments Vision Builder 7, which DLLs are registered under \system32 folder (the package works with no problem) In this object, I have to pass an UDT that is a struct containing a safearray of another struct and two integer (that is, the safearray contains the RGB Values of all the points of my image and the two integers keep the image size). These structures are shown below. When I compile, I get MIDL warning 2368: Could not set UUID ... etc etc etc... but I've seen that this can be ignored with no problems. Now, when I run both client and server, I get an error when preparing to pack the safearray. In facts, I call GetRecordInfoFromGuids to build my SafeArray with VT_RECORD. Before, I was not doing error checking and everything seemed to be alright, but I got crashes. Now, that I added an if (FAILED(hr)) statement just after the call, I get a 0x80029C4A value, that is "Cannot load type library/DLL". Here's the structs:
typedef [uuid(394143BC-4672-4E14-85DB-A96EBCA5A417), version(1.0), helpstring("RGB Representation of a single point")] struct RGBValue_struct { unsigned char B; //The blue value of the color. unsigned char G; //The green value of the color. unsigned char R; //The red value of the color. unsigned char alpha; //The alpha value of the color, which represents extra information about a color image, such as gamma correction. } RGBValue; typedef // {7F7037D8-C4D5-4b75-9C68-A9627EDE914B} [uuid(7F7037D8-C4D5-4b75-9C68-A9627EDE914B), version(1.0), helpstring("IVA_Data COM Wrapper")] struct COM_IVA_Data { SAFEARRAY(PointFloat) saPoints; int numPoints; int pointIndex; }COM_IVA_Data;
Here's the function call :HRESULT Image2Variant (IVA_Image Source, COM_IVA_Image *Dest) { HRESULT hr = 0; // Initializing dimension descriptor for our SafeArray SAFEARRAYBOUND sabRGB[2]; sabRGB[0].lLbound = 0; sabRGB[0].cElements = Source.columns * Source.rows; hr = SafeArrayDestroy(Dest->saPoints); if (hr != 0) { sprintf(logMessage, "CAugVisionEngine - Image2Variant - SafeArrayDestroy Failed (%ld)",hr); WriteLogFile(logMessage); } Dest->saPoints = NULL; IRecordInfo *pUDTRecordInfo = NULL; hr = ::GetRecordInfoFromGuids(LIBID_AugSvrLib, 1,0,0,RGBValue_IID, &pUDTRecordInfo); if (FAILED(hr))
-
Hi folks, I'm developing a DCOM Client/Server project under Win2000 SP4 (both client and server) with VC++ 6.0. An object in this project has to interface with National Instruments Vision Builder 7, which DLLs are registered under \system32 folder (the package works with no problem) In this object, I have to pass an UDT that is a struct containing a safearray of another struct and two integer (that is, the safearray contains the RGB Values of all the points of my image and the two integers keep the image size). These structures are shown below. When I compile, I get MIDL warning 2368: Could not set UUID ... etc etc etc... but I've seen that this can be ignored with no problems. Now, when I run both client and server, I get an error when preparing to pack the safearray. In facts, I call GetRecordInfoFromGuids to build my SafeArray with VT_RECORD. Before, I was not doing error checking and everything seemed to be alright, but I got crashes. Now, that I added an if (FAILED(hr)) statement just after the call, I get a 0x80029C4A value, that is "Cannot load type library/DLL". Here's the structs:
typedef [uuid(394143BC-4672-4E14-85DB-A96EBCA5A417), version(1.0), helpstring("RGB Representation of a single point")] struct RGBValue_struct { unsigned char B; //The blue value of the color. unsigned char G; //The green value of the color. unsigned char R; //The red value of the color. unsigned char alpha; //The alpha value of the color, which represents extra information about a color image, such as gamma correction. } RGBValue; typedef // {7F7037D8-C4D5-4b75-9C68-A9627EDE914B} [uuid(7F7037D8-C4D5-4b75-9C68-A9627EDE914B), version(1.0), helpstring("IVA_Data COM Wrapper")] struct COM_IVA_Data { SAFEARRAY(PointFloat) saPoints; int numPoints; int pointIndex; }COM_IVA_Data;
Here's the function call :HRESULT Image2Variant (IVA_Image Source, COM_IVA_Image *Dest) { HRESULT hr = 0; // Initializing dimension descriptor for our SafeArray SAFEARRAYBOUND sabRGB[2]; sabRGB[0].lLbound = 0; sabRGB[0].cElements = Source.columns * Source.rows; hr = SafeArrayDestroy(Dest->saPoints); if (hr != 0) { sprintf(logMessage, "CAugVisionEngine - Image2Variant - SafeArrayDestroy Failed (%ld)",hr); WriteLogFile(logMessage); } Dest->saPoints = NULL; IRecordInfo *pUDTRecordInfo = NULL; hr = ::GetRecordInfoFromGuids(LIBID_AugSvrLib, 1,0,0,RGBValue_IID, &pUDTRecordInfo); if (FAILED(hr))
just a guess.. i have always seen iid name to be seen as class name.. RGBValue_struct_IID inplace of RGBValue_IID ....in ::GetRecordInfoFromGuids(LIBID_AugSvrLib, 1,0,0,RGBValue_IID, &pUDTRecordInfo); if still problem persists ...need more info .. >>>> cheers vibhash
-
just a guess.. i have always seen iid name to be seen as class name.. RGBValue_struct_IID inplace of RGBValue_IID ....in ::GetRecordInfoFromGuids(LIBID_AugSvrLib, 1,0,0,RGBValue_IID, &pUDTRecordInfo); if still problem persists ...need more info .. >>>> cheers vibhash