|
Dear All,
I have a MFC application and also i am having a COM interface with that application. Both are running at the same address space.
Now that MFC application is up, when I call that COM interface from different program, everything goes correct. well.
After the COM fn execution is done, the MFC application goes out of memory (application stoped).
What is the reason for this?
I need to have MFC application to be in memory still even COM fn is done.
To do this, what should i do ? How can i do this ?
Kindly help me.
Thanks.
|
|
|
|
|
Perhaps an extra IYourInterface::Release() happens caused by returning the interface pointer to the client via GetIDispatch(FALSE). Must be GetIDispatch(TRUE) to increase internal reference count.
hallelujah
|
|
|
|
|
Want to call a dll which is created in vb 6 in vb.net. How i can do that. I am using dllImport but when running the .net aplication there is one error that Entry Point not define. Please provide solution that will highly appreciated.
|
|
|
|
|
Is it a COM dll? You can check this with OLEView or look to see if it exports the normal COM functions. If so you need to generate a RCW[^] (Runtime Callable Wrapper) for the DLL. I'm not a dotNET programmer so I can't help you with the specifics.
Steve
|
|
|
|
|
hi all
how to create and terminate a process using WMI
Can i have c++ code for it
Thanks
abhi
|
|
|
|
|
Hello everybody,
I have a COM client application which connects to COM server on the same machine. Everything works fine. But when I start the client from an asp script, the call to CoCreateInstance fails for some reasons. I`m not very experienced in COM programming. Do I have to use CoCreateInstanceEx because the client runs in the context of the webserver when it is started from the script? Or whatelse could be the reason? Does anybody have an idea?
MS
|
|
|
|
|
Hi All
whats the best way if a treeview node is associated with 3 values more easily i say that when click on the node 3 values are displayed in Listview for that node how to bind the values with that particular node
SAS
|
|
|
|
|
wrong forum. I think your question is not related to COM. Try VC++ forum to get correct and fast answer.
S o h a i l K a d i w a l a
To Err Is Human; to Debug, Divine
modified 21-Apr-21 21:01pm.
|
|
|
|
|
Hi
First: I know there are many topics in codeproject about using BSTR but i cant help myself further after 2 days trying to solve this problem...
1) Situation
============
My task is to write a program in VC++ which makes a windows program communicate to a sensor (MTi). There is a fully functional command line program from the producer of the sensor. Now i want to change severel settings (using specific functions) of the sensor like sample frequency and so on. The main function makes a Motion Tracker Object (written in c) to realize the communication through a virtual COM Port.
2) Problem
==========
I want to change the sample frequency of the data exchange between the program and the sensor (default it is 100Hz which is to fast for my application):
<br />
int nSFreq=25;
int nUSFreq=0;
pMT->MT_SetMotionTrackerSampleFrequency(nSFreq);<br />
MT_GetMotionTrackerSampleFrequency(&nUSFreq);<br />
printf("Your sample Frequency %d", nUSFreq);<br />
--> the command line shows 25 as expected, but the sensor samples still with 100Hz. Now i read that i have to safe the settings on the sensor using the sensor ID which is a BSTR. The ID i can get from this function:
<br />
virtual HRESULT STDMETHODCALLTYPE MT_QueryMotionTrackerB(<br />
BSTR __RPC_FAR *bstrDeviceID) = 0;<br />
virtual HRESULT STDMETHODCALLTYPE MT_SaveToMTS( <br />
BSTR bstrDeviceID) = 0;<br />
--> now, what i have done in my program:
<br />
BSTR nDId;<br />
pMT->MT_QueryMotionTrackerB(&nDId);<br />
pMT->MT_SaveToMTS(nDId);<br />
-->The program compiles very nice but when i run the .exe i got this damn error message all the time:
"An exception 'System.NullRefereceException' has occured in MTi.cmd1.exe"
(-->The error is only caused when i use the BSTR function shown above)
I know the problem is this BSTR but i cant help myself. Maybe someone can tell me what i need to do.
1000Thx
chris
|
|
|
|
|
Hi,
Just use CComBSTR instead of BSTR and use CString to convert from BSTR to char* and visa versa.
Regards
|
|
|
|
|
chrigi001 wrote: -->The program compiles very nice but when i run the .exe i got this damn error message all the time:
"An exception 'System.NullRefereceException' has occured in MTi.cmd1.exe"
(-->The error is only caused when i use the BSTR function shown above)
Problem may not be with BSTR as you think. Can you check if MT_QueryMotionTrackerB gives value correctly. Or which function of them is giving exception.
chrigi001 wrote: "An exception 'System.NullRefereceException' has occured in
Generally, this exception occurs due to accessing NULL pointer as it indicates. See by placing checks at places wherever you can.
|
|
|
|
|
Please tell me how to debug in add_ins;There is some problem in my programme,but i not know how to debug it ;please help!
|
|
|
|
|
Sorry, we dont lease help here
|
|
|
|
|
|
You need to give host exe's path to debug your add-in. And put break point in connecting function of your add-in. i.e. function through which add-in and host application communicate. And follow usual debugging technique.
|
|
|
|
|
Hi all,
I am not too sure where to post my question, so I'll just put it here and hope that somebody will help me. Honestly, I've reached a deadend after searching ALOT. I'll greatly appreciate any help or indication.
The problem:
In Internet Explorer you can right-click on a page and hit "Export to Microsoft Excel". This command is set in the registry (HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\Export to Microsoft Excel) to call Excel with "EXCEL.EXE/3000".
The purpose:
I would like to develop a executable with simular functionality: the ability to be called from the internet explorer.
The question:
What is the technology that excel is using? Is it a COM object implementing an interface? How do I do that in .NET? And what on earth is that "/3000" parameter?!?
I've been looking for an answer for quite some time now. Please help.
Rgds,
G.
-- modified at 5:36 Thursday 14th December, 2006
|
|
|
|
|
Did you browse through
http://msdn.microsoft.com/workshop/browser/ext/extensions.asp
_________________________
"When the superior man refrains from acting, his force is felt for a thousand li." Sun Tzu
|
|
|
|
|
Yeap! There is an article there called "Adding Entries to the Standard Context Menu", which is relevant with the case, but unfortunately it doesn't mention anything about how the executable should be made (i.e. what interfaces should implement, how they are exposed etc).
Note that the whole thing works if I set the right-click to call a javascript htm page, but not if I call an executable.
..and I am very curious to find what this "\3000" param is..
|
|
|
|
|
Given the big red text that says "Do not post programming questions (use the programming forums for that)" why did you think posting it here would be a good idea?
Your post in the C# forum was a better choice.
|
|
|
|
|
And if you look here and then in the C# forum, the lounge has given him more feedback than the C# forum
He who laughs last is a bit on the slow side
|
|
|
|
|
I apologize for this. I saw the text only after I hit the "send" button (too overwhelmed with the issue I guess )
Strange enough, though, I got an answer from this thread instead of the "C#" one!
|
|
|
|
|
ghost1207 wrote: Strange enough, though, I got an answer from this thread instead of the "C#" one!
Maybe, but you've irritated people in the process.
|
|
|
|
|
Hallo,
I want to export the objects on a powerpoint-slide via office automation.
I use Visual Studio .NET 2005 an Office 2003. When I try the funktion
Shape.Export(filename, PowerPoint.PpShapeFormat.ppShapeFormatGIF, width, height, PowerPoint.PpExportMode.ppClipRelativeToSlide);
i get the images, cliparts, etc.. But they don´t have the specified width and height.
The Dimension of the Shapes differs in horizontal and vertical dpi. How can I set correct DPI-sizes and Pixel-sizes?
Thx,
Tobias
|
|
|
|
|
Hi all,
I am wondering if it is possible to determine the size (or number of valid function entries) of a virtual function table using the queried interface pointer.
Say I obtained an interface pointer pIMy via QueryInterface:
pIBase->QueryInterface(&IID_MYINTERFACE, (void**)&pIMy, hr);
I was able to cast the pIMy to vtable pointer pVTable and access each each function's address value with pVTable[0], pVTable[1]..etc. And obviously sizeof(pVTable) returns 4 instead of size of the vtable.
Any ideas how it is possible to determine the size virtual function table?
Thanks in advance,
J.B.
|
|
|
|
|
Perhaps there's a trick that I'm not aware of, but I don't think you can get the size of the vtable in runtime.
If you create an interface that inherits from IUnknown, the first 12 bytes of the vtable will be the addresses of QueryInterface(), AddRef() and Release(). The next four bytes will contain the address of the first method for the new (child) interface and so on until the vtable is complete. The bytes following the vtable will contain data for the member variables, there's no "padding" or "termination" of the vtable, hence I don't think you can tell the size of it in runtime. Perhaps there's a trick when building for 'Debug', but I don't think so.
On the other hand: why do you want to know the size of the vtable?
Perhaps there's another solution for your problem.
--
Roger
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"No one remembers a coward!" - Jan Elfström 1998 "...but everyone remembers an idiot!" - my lawyer 2005 when heard of Jan's saying above
|
|
|
|