Click here to Skip to main content
15,905,508 members
Home / Discussions / COM
   

COM

 
AnswerRe: Unable to get the problem. Pin
User 21559731-Jan-07 0:25
User 21559731-Jan-07 0:25 
QuestionWrite a IE toolbar by VS 2005 Pin
saminjesus29-Jan-07 22:31
saminjesus29-Jan-07 22:31 
AnswerRe: Write a IE toolbar by VS 2005 Pin
prasad_som29-Jan-07 23:03
prasad_som29-Jan-07 23:03 
GeneralRe: Write a IE toolbar by VS 2005 Pin
saminjesus30-Jan-07 14:46
saminjesus30-Jan-07 14:46 
AnswerRe: Write a IE toolbar by VS 2005 Pin
prasad_som30-Jan-07 17:06
prasad_som30-Jan-07 17:06 
GeneralRe: Write a IE toolbar by VS 2005 Pin
saminjesus31-Jan-07 16:01
saminjesus31-Jan-07 16:01 
AnswerRe: Write a IE toolbar by VS 2005 Pin
host287-Feb-07 15:04
host287-Feb-07 15:04 
QuestionUnknown fault trying connect to an OPC-Server Pin
Biasto29-Jan-07 20:05
Biasto29-Jan-07 20:05 
Hello,

I've just tried to handle an OPC-interface with VC++ 6.0

Therefor I create an Instance of the interface to get the a pointer of this interface.

This should be ok,
but...

when I want to get access to the methods of the interface, I always get unknown failure codes back:

Interface Instance:


IOPCBrowseServerAddressSpace* InstantiateOPCBrowseServerAddressSpace(wchar_t ServerName[])
{
HRESULT hr;
CLSID CLSID_OPCServer;
CLSID CLSID_OPCServer2;

void** ppIntfObj = NULL;

// Get GUID and UUID from regsitry for COM-Server
hr = CLSIDFromProgID(ServerName, &CLSID_OPCServer2);
ShowError(hr);

// Queue of Class-Instances to create
LONG cmq = 1; // number of class instances to create
MULTI_QI queue[1] = {{&IID_IOPCBrowseServerAddressSpace,
NULL,
0}};

//Create an instance of the IOPCBrowse
hr = CoCreateInstanceEx(CLSID_OPCServer, NULL, CLSCTX_SERVER, /*&CoServerInfo */ NULL,
cmq, queue);
ShowError(hr);


// Return Pointer to the IOPCBrowse Interface
return(IOPCBrowseServerAddressSpace*) queue[0].pItf;
}




In my main-method, I try to work with the interface,
but I only get two different failures as HRESULT:

0x000006F4 in the first attempt.

and 0xC0000005 in the second and third attempt. (this means here Access Violation?)

Implementation in main-method:



CoInitialize(NULL); //Using MS Com library



//Instanciate Browse-Interface
IOPCBrowseServerAddressSpace *pOPCBrowse2 = InstantiateOPCBrowseServerAddressSpace(L"SOFTING.OPCToolboxDemo_ServerDA");
//Declarations for OPCBrowse
HRESULT hr;

OPCBROWSEDIRECTION dwBrowseDir = OPC_BROWSE_TO;

hr = pOPCBrowse2->ChangeBrowsePosition(dwBrowseDir, NULL);
ShowError(hr);

OPCNAMESPACETYPE *pNameSpaceType;
hr = pOPCBrowse2->QueryOrganization(pNameSpaceType);
ShowError(hr);

OPCBROWSETYPE dwBrowseType = OPC_FLAT;
LPENUMSTRING *pIEnumString;

hr = pOPCBrowse2->BrowseOPCItemIDs(dwBrowseType, NULL /*Filter*/, 0, 0, pIEnumString);
ShowError(hr);

...



Where could be my problem.
The interface is defined in an IDL-Sheet from the OPC-Foundation.

Perhaps you've got an intension, if there is anything wrong with my interface handling or coding?

Thanks for your work at this time

Biasto
AnswerRe: Unknown fault trying connect to an OPC-Server Pin
User 21559730-Jan-07 1:12
User 21559730-Jan-07 1:12 
GeneralRe: Unknown fault trying connect to an OPC-Server Pin
Biasto30-Jan-07 3:19
Biasto30-Jan-07 3:19 
QuestionWhen Servers Crash! Pin
Michael Bergman29-Jan-07 8:50
Michael Bergman29-Jan-07 8:50 
QuestionFocus-Problem with IWebBrowser2 Pin
steven1129-Jan-07 4:31
steven1129-Jan-07 4:31 
QuestionWindows Media Server 9 and IWMSBufferAllocator Pin
Tili29-Jan-07 0:08
Tili29-Jan-07 0:08 
QuestionHow do i do a dialog from vbscript Pin
markpetryk29-Jan-07 0:05
markpetryk29-Jan-07 0:05 
QuestionList all network interfaces (offline and online) Pin
Fabricio Godoy26-Jan-07 7:38
Fabricio Godoy26-Jan-07 7:38 
Questionhow to use tlbinf32.dll Pin
huangdingjun25-Jan-07 14:12
huangdingjun25-Jan-07 14:12 
AnswerRe: how to use tlbinf32.dll Pin
User 21559726-Jan-07 6:12
User 21559726-Jan-07 6:12 
GeneralRe: how to use tlbinf32.dll Pin
huangdingjun30-Jan-07 16:17
huangdingjun30-Jan-07 16:17 
QuestionCOM objects all unregistered Pin
Marcus J. Smith24-Jan-07 0:29
professionalMarcus J. Smith24-Jan-07 0:29 
AnswerRe: COM objects all unregistered Pin
Roger Stoltz24-Jan-07 1:14
Roger Stoltz24-Jan-07 1:14 
JokeRe: COM objects all unregistered Pin
User 21559724-Jan-07 5:37
User 21559724-Jan-07 5:37 
GeneralRe: COM objects all unregistered Pin
Marcus J. Smith27-Jan-07 2:54
professionalMarcus J. Smith27-Jan-07 2:54 
GeneralRe: COM objects all unregistered Pin
prasad_som25-Jan-07 17:05
prasad_som25-Jan-07 17:05 
QuestionSending command through serial port - error Overlapped I/O operation in process Pin
Matt_deveau23-Jan-07 11:30
Matt_deveau23-Jan-07 11:30 
AnswerRe: Sending command through serial port - error Overlapped I/O operation in process Pin
Tim Paaschen23-Jan-07 19:21
Tim Paaschen23-Jan-07 19:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.