|
Try registering and look at the result? Or search the COM registry area for a reference to that dll/exe?
|
|
|
|
|
Why do you need to do this?
|
|
|
|
|
I was wondering that too.
Steve
|
|
|
|
|
Hello All,
I am working on an OPC HDA Client where I am creating a Conenction with OSI PI HDA Server via below code. But at the time of Advise to the Server I am getting an error with error code = 0x80040202. The OSI HDA server is located on remote machine which has full DCOM configuration. I searched out and found that this happens due to CONNECT_E_ADVISELIMIT or CONNECT_E_CANNOTCONNECT. Below is the my code of Connect(). Can anybody help me what else I have to do to fix the problem.
void HdaServer::Connect()
{
try
{
Debugger::Launch();
OpcServer::Connect();
#pragma region Code Added For AsyncOperations
ATL::CComPtr<::IConnectionPointContainer> subscripCpcObj = GetAtlInterface<::IConnectionPointContainer>((this->RawObject));
ATL::CComPtr<::IConnectionPoint> eventObjPtr;
HRESULT hr = subscripCpcObj->FindConnectionPoint(__uuidof(IOPCHDA_DataCallback), &eventObjPtr);
this->CheckResult(hr);
IntPtr cbPtr = Marshal::GetComInterfaceForObject(this, OpcHdaEventSink::typeid);
ATL::CComQIPtr<IOPCEventSink> callbackPtr;
callbackPtr = reinterpret_cast<IOPCEventSink*>(cbPtr.ToPointer());
DWORD cookie;
hr = eventObjPtr->Advise(callbackPtr, &cookie);
this->CheckResult(hr);
this->callbackCookie = cookie;
this->callbackConnectionPoint = GetDotNetInterface<::IConnectionPoint>(eventObjPtr);
if(this->callbackConnectionPoint == nullptr)
{
OutputDebugString(L"HdaServer:->callbackConnectionPoint is NULL!");
}
#pragma endregion
}
catch(Exception^ ex)
{
throw ex;
}
}
ANURAG VISHNOI,
Sr. Software Engineer,
|
|
|
|
|
The IConnectionPoint::Advise implementation contains:
...
hRes = pUnkSink->QueryInterface(iid, (void**)&p);
....
else if (hRes == E_NOINTERFACE)
hRes = CONNECT_E_CANNOTCONNECT;
if (FAILED(hRes))
*pdwCookie = 0;
return hRes;
Maybe you are getting CONNECT_E_CANNOTCONNECT because E_NOINTERFACE was returned by the QI call?
|
|
|
|
|
Hey tanks for the answer. But the question how can I solve this issue. Because I am able to connect with other servers but not with a specific type. Advise() fails only for OSI.HDA Server.
Thanks,
Anurag
ANURAG VISHNOI,
Sr. Software Engineer,
|
|
|
|
|
Hello sir,
I have created the COM component in VC6.0 using ATL 3.0
I am using it in VB6.0
I have added the BSTR Event.
I want to pass the string with NULL character in between the string from VC to VB
e.g. I want to fire a event with string "ABC\0XYZ"
So I can get the complete string in VB as ABC[]XYZ
[] - indicates box as unicode character.
But I am getting only "ABC" string.
Please tell me the way to pass the string with NULL character from vc to vb.
It's very urgent.
Please do the needful.
Thanks.
|
|
|
|
|
Note: Without seeing any of your code, I'm just guessing...
It's probably because when you create the BSTR, you let it count characters to determine its length, rather than telling it what the length actually is. Any string length function in C/C++ will see a NULL as the end of string.
So, create your BSTR like this, telling it what its length is:
BST b = SysAllocStringLen(L"ABC\0XYZ", 7);
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
CodeProject MVP for 2010 - who'd'a thunk it!
|
|
|
|
|
Still I am getting only ABC in VB
So please tell me how to send full string.
I am getting what you have told me. but I want to transfer this full string from vc to vb.
So please tell me the solution
It's very urgent
Thanks for help.
|
|
|
|
|
This begs an obvious question: can VB handle strings with embedded NULLs? Many of C's CRT functions such as wcscmp can't for example.
Steve
|
|
|
|
|
As I recall you won't be able to do as you want, either the ATL Event Wizard generated code sees the internal NULL and loses the rest (even with the BSTR length set) or VB will see a a NULL terminated string. I'm pretty sure You'll have do do more one way or the other. Maybe pass an array of characters?
|
|
|
|
|
The NULL character is your problem. Try replacing it with some other unique Unicode character which both parts of your application can recognise. Alternatively put the box character in your source string in the first place.
It's time for a new signature.
|
|
|
|
|
Hello Friends
I am using namespace MSXML in my application to traverse and read XML file.But I have some confusion regarding MSXML is that this one is related to c++ DOM APIs na? And what its relation with COM?
And these both COM AND DOM are provoding different APIs?and then what is DCOM?
Please Suggest me something.I am too confused.
Thanks & Regards
Yogesh
|
|
|
|
|
you should read about the TLAs.
The short run:
MSXML is MS-XML and implemented in a COM-object. It uses the DOM of XML.
And DCOM is completly different. It is D-COM. D stand for distributed.
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
Hi,i am creating a Outlook plugin in ATL to get export the selected mail details to a web service.I am able to get the mail details.
But i occasionally get "Could not complete the operation.One or more parameters are invalid" messagebox when i click on Send/Receive.
Once i reopen the outlook, i am able to do Send/Receive.
I could not figure out in what scenario the error occurs.Pls help.
|
|
|
|
|
did you introduce new controls such as button to outlook UI for this purpose? or did you subscribed for Send/Receive event via connectionPoint? Explaining the procedure you have followed may help to get quick solutions..
|
|
|
|
|
I have introduced new toolbar using ATL.On selecting some mails and clicking on the button, mail details will be sent to a web service.The part of retrieving the mail details is working fine.On doing the export a few times, and then clicking on Send/Receive button, a message box "Could not complete the operation" appears.
As the message box does not appear on a single Export action, i could not find the scenario.
|
|
|
|
|
problem seems strange, but after googling the error msg, it is found that this error msg comes in several other scenarios like repeatedly creating New Appointment, New Tasks etc also. So can we conclude that repeatedly retrieving mail items conflicts with send/receive action.? 
|
|
|
|
|
thanks for your time..
yes.. the error msg comes in several case in outlook.i am trying to find what causes the Send/Receive action to show the error msg.
what object of outlook gets changed, so the error occurs on the Send/Receive action??
|
|
|
|
|
Hi All..
I need to use FFDShow interfaces in my VC++ project. how can i proceed. I got ffdshow.ax file from the FFDShow instalation directory. But there is no tlb file to import. Can i use this .ax file for getting the interfaces...? Or any other methods there to proceed...
Please help me...
|
|
|
|
|
directshow filters normally doesn't have a typelib, because its not necessary for them to support IDispatch interface. Isn't it possible to get header files of ffdshow? How did you solve the problem?
|
|
|
|
|
Still i am not able to fix the problem. For the time being i am using the FFDShow registry settings for my purpose. But this is not A PERMANENT SOLUTION for me...
|
|
|
|
|
I have the following method to capture image from a window it works ok but today it save the same image to disk every times called. Please help me! I cannot understand what is the problem.
_______________________________________________
public void GetWindowPicture(IntPtr hWnd)
{
IntPtr hdcDest = default(IntPtr);
IntPtr hdcSrc = default(IntPtr);
RECT r = new RECT();
int w = 0;
int h = 0;
GetWindowRect(hWnd, ref r);
w = r.Right - r.Left;
h = r.Bottom - r.Top;
Bitmap bm = new Bitmap(w, h);
Graphics g = Graphics.FromImage(bm);
hdcSrc = GetWindowDC(hWnd);
hdcDest = g.GetHdc();
BitBlt(hdcDest, 0, 0, w, h, hdcSrc, 0, 0, SRCCOPY);
g.ReleaseHdc(hdcDest);
ReleaseDC(hWnd, hdcSrc);
bm.Save(GetOutputInfo(),System.Drawing.Imaging.ImageFormat.Jpeg);
}
_____________________________________
Thanks for your attention,
|
|
|
|
|
This doesn't really look like a COM problem,...but, copying the same image every time is probably because the HWND is the same every time.
Give us some context as to where in an application this code is being executed.
|
|
|
|
|
Hello All,
I tried to register simpleui5.ocx control in system32 from command prompt but not able to and i came across with the error LoadLibrary("c:\windows\system32\simpleui5.ocx") failed - invalid access memory location.
Can any buddy tell me how do i successfully register this active x control?
Best regards,
Ghaffar
I am an intermediate in this fantastic filed of science. I want to gain knowledge from profesionals of high caliber & Offcourse I want to share with other.
|
|
|
|