Home > Software engineering >  Com connection error bound
Com connection error bound

Time:09-30

 if (g_cdma ConnectCom (_T (" COM "))) 
{
Retrieves the hr;
IConnectionPointContainer * pConnectionPointContainer=NULL;
IConnectionPoint * pConnectionPoint=NULL;
Hr=g_cdma. M_lpDispatch - & gt; QueryInterface (IID_IConnectionPointContainer, (void * *) & amp; PConnectionPointContainer);
Hr=pConnectionPointContainer - & gt; FindConnectionPoint (__uuidof (ICDMAXEvents), & amp; PConnectionPoint);
DWORD dwCookie;
Hr=pConnectionPoint - & gt; Advise (IUnknown (*) (this), & amp; DwCookie);
G_cdma. GetVersion ();
G_cdmaConnected=true;
}
g_cdma for com component object, perform a variety of functions, operation this inherited the event callback interface, Advice () call the return value is s_ok, but the execution times wrong,

CodePudding user response:

GetLastError

In a 64 - bit Windows:
64 exe and DLL in the directory c: \ Windows \ sys tem32 directory.
32 bit exe and DLL in the directory c: \ Windows \ sys wow64 directory.
So pay attention to:
In win64 system registered under 32-bit ocx DLL to 32 ocx or copy the DLL to the c: \ Windows \ syswow64 \ directory,
And registered to c: \ Windows \ syswow64 \ regsvr32 XXXXXXX ocx or DLL
Under win64 a system set up 32-bit programs use a database alias to c: \ Windows \ \ syswow64 \ cliconfg exe
Under win64 a system set up a 32-bit application system DSN to c: \ Windows \ \ syswow64 \ odbcad32 exe
A 64 - bit Windows platform attention point of the file system redirection http://www.cnblogs.com/jiake/p/4981555.html
64 - bit Windows platforms attention point of the registry to redirect http://www.cnblogs.com/jiake/p/4956218.html

CodePudding user response:

Collapsed in the pop-up dialog box, press the corresponding button to enter debugging press Alt + 7 key to view the Call Stack, namely "the Call Stack" from the inside to the following out of from the inner to outer function Call history, double-click a row to the cursor to the Call of the source code or assembly instruction, don't understand when double click on the next line, until we can read ,

CodePudding user response:

reference 1st floor zhao4zhong1 response:
GetLastError

In a 64 - bit Windows:
64 exe and DLL in the directory c: \ Windows \ sys tem32 directory.
32 bit exe and DLL in the directory c: \ Windows \ sys wow64 directory.
So pay attention to:
In win64 system registered under 32-bit ocx DLL to 32 ocx or copy the DLL to the c: \ Windows \ syswow64 \ directory,
And registered to c: \ Windows \ syswow64 \ regsvr32 XXXXXXX ocx or DLL
Under win64 a system set up 32-bit programs use a database alias to c: \ Windows \ \ syswow64 \ cliconfg exe
Under win64 a system set up a 32-bit application system DSN to c: \ Windows \ \ syswow64 \ odbcad32 exe
A 64 - bit Windows platform attention point of the file system redirection http://www.cnblogs.com/jiake/p/4981555.html
64 - bit Windows platforms attention point of the registry to redirect http://www.cnblogs.com/jiake/p/4956218.html
the error popup window has been upload screenshots, g_cdma function is no problem, is can't understand how the callback callback, an error is the Access violation at address 101 ef9a2 module in 'mfc120ud. DLL', the Read of address 00000021

CodePudding user response:

Fyi:
COINIT
A set of values from the COINIT enumeration is passed as the dwCoInit parameter to CoInitializeEx. This value determines the concurrency model, informs the for incoming calls objects created by This thread. This concurrency model can be either apartment - threaded or multi - threaded.

The COINIT enumeration is defined as follows:

Typedef enum tagCOINIT {
COINIT_APARTMENTTHREADED=0 x2,//Apartment model
COINIT_MULTITHREADED=0 x0,//calls OLE objects on any thread.
COINIT_DISABLE_OLE1DDE=0 x4,//Don 't use DDE for Ole1 support.
COINIT_SPEED_OVER_MEMORY=0 by 8,//Trade memory for speed.
} COINIT;

Elements
COINIT_MULTITHREADED
Initializes the thread for multi - threaded object concurrency (see few).
COINIT_APARTMENTTHREADED
Initializes the thread for apartment - implementing object concurrency (see few).
COINIT_DISABLE_OLE1DDE
Disables DDE for Ole1 support.
COINIT_SPEED_OVER_MEMORY
Trades the memory for speed.
Few
When a thread is initialized through a call to CoInitializeEx, you choose been to initialize it as apartment - threaded or multi - threaded by designating one of the members of COINIT as its second parameter. This designates how incoming calls to any object created by that thread are handled, that is, the object 's concurrency.

Apartment-threading, the default model for earlier versions of Windows NT, while allowing for multiple threads of execution, serializes all incoming calls by requiring that calls to methods of objects created by this thread always run on the same thread – the apartment/thread that created them. In addition, calls can arrive only at message-queue boundaries (i.e., only during a PeekMessage, SendMessage, DispatchMessage, etc.). Because of this serialization, it is not typically necessary to write concurrency control into the code for the object, other than to avoid calls to PeekMessage and SendMessage during processing that must not be interrupted by other method invocations or calls to other objects in the same apartment/thread.

nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related