 |
|
 |
I'have done both tutorials (VC6 and this one) and this one is also excelent!
|
|
|
|
 |
|
 |
Exactly what I was looking for! Thanks.
- Bob
Bob Ciora
|
|
|
|
 |
|
 |
Thanx ThatsAlok.
I have builded a simple COM/ATL DLL by VC2010 just like u. And the COM object has event too.
I test it by VC#, uses easy and correct. But I wanna use it in VC++ program, I dont know how to handle the event.
Did u know how to use it in VC++? (VS2005, 2008 or 2010 will be ok). Can u give a sample project? Thanx a lot.
|
|
|
|
 |
|
 |
yeap, there is very good wrapper written one of my favourite author, you may try this link Understanding COM Event Handling[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
 |
|
 |
Thanx for ur quick response.
I saw the link and tested the project, it can work normally.
But I wanna use ATL to handle the event by VS 2008 or VS2010. How can I do?
|
|
|
|
 |
|
 |
Hello,
It shows "System.AccessViolationException" error. What could be the problem. Please help me to solve this.
Thanks,
Sowbhagya
|
|
|
|
 |
|
 |
Sowbhagya Sanjeev wrote: It shows "System.AccessViolationException" error. What could be the problem. Please help me to solve this.
Let me know where exactly you getting this error?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
 |
|
 |
Hi Alok,
I have implemented one COM plug-in for Acrobat and placed in plug-ins (C:\Program Files (x86)\Adobe\Acrobat 10.0\Acrobat\plug_ins) folder.
I have created one C# application. In that I have created instance for Acrobat.
Am calling function which I have written in COM plug-in. The function should open one PDF file and get information from that.
It shows error while opening file in acrobat. The same code works without COM.
What could be the problem.
Please help me to solve this issue.
Thanks,
Sowbhagya
|
|
|
|
 |
|
 |
Sowbhagya Sanjeev wrote: I have implemented one COM plug-in for Acrobat and placed in plug-ins (C:\Program Files (x86)\Adobe\Acrobat 10.0\Acrobat\plug_ins) folder.
I am extremly sorry, i have no knowledge how Adobe handle it's plug-ins. I believe doesn't lies in com-component but in the way adobe handle it's plugin. see you getting access-violation error, these mean it's not able get access which is requires.
this seems to be problem more close to product handling of plug-in rather than COM itself.!
Regards
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
 |
|
 |
Thanks for your article. I used Windows 7 and VS 2010 to develop this. But it shows below error.
Error 1 The type 'SampleATMcomLib.SimpleComClass' has no constructors defined \SimpleATlComTest\SimpleATlComTest\Form1.cs 16 35 SimpleATlComTest
What could be the problem.
Please help me to solve this error.
Thanks in Advance,
Sowbhagya
|
|
|
|
 |
|
 |
Hi Sowbhagya,
Thank you for going through article, let me check same on VS2010. my small question is are you developing from scratch or using solutions file attached with article.
If later is true, i recommend you to create a new solutions in VS2010 using instruction present here.!
regards
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
 |
|
|
 |
|
 |
I have not been able to run the example on the x64 Windows 7 platform using either Visual Studio 2008 or Visual Studio 2010. When I try to execute the C# code I get the error:
Retrieving the COM class factory for component with CLSID {A7657FC5-D63C-49C3-AEE5-D8799F412C74} failed due to the following error: 80040154.
After chasing down a copy of rpcndr.lib in a WinDDk I was able to build and run the example on a 32-bit version of Windows 7 using Visual Studio 2008.
|
|
|
|
 |
|
 |
Make sure that you are building a x86 executable:
Go to properties, Build->Platform target and change it to x86.
|
|
|
|
 |
|
 |
Thank you. It is very useful.
|
|
|
|
 |
|
 |
Thank you. It is very useful.
cheers,
Goutam
|
|
|
|
 |
|
 |
It's really a nice article, and helps me a lot. However, I did have a further quesion. Could I use COM wrapper instead of adding a reference? If so, could you share your experience or documentation about this to me?
Many thanks again.
|
|
|
|
 |
|
 |
It is nice to use the visual when everything works. Unfirtunately, with as many version of Visual Studio and as often as it happens that your project's smart syntax goes nuts, it is best to leatn how to expand your COM library by hand, which also gives you much more flexibility that you cannot have from Wizards. For instance, Wizards won't even lett you pass an interface as a parameter, you have to change things manually, and so on...
Would have been also nice to have references to advanced material for others to continue after...
|
|
|
|
 |
|
 |
In Step 6, you state to right click on ISimpleComEvents and Add | Add method.
However, all I see when I right click under Add is Add Function and Add Variable. Add Function is just putting in a class function, not a COM method. I am using Visual Studio 2008, not 2005 like yourself.
Any ideas what's going on?
Thanks,
Dave
|
|
|
|
 |
|
 |
It is possible that something went wrong with your project's automation. Just add a new function by hand and then implement it within C++. It is the easiest way.
|
|
|
|
 |
|
 |
Hi Dave,
In the Class View, search for ISimpleComEvents and right click on the ISimpleComEvents with Interface Icon to see the Add Method/Property. I hope you have clicked the class icon to see the Add Function/Variable menu items.
Thank you,
Sivadhas Mani
|
|
|
|
 |
|
 |
Hey can anyone halp me hw to create COM component VC++ and use that in C++????????
Also want to know about Java Native Interface???????????
|
|
|
|
 |
|
 |
There is no such language as VC++, if you are talking of the Visual C++ compiler, well it is just a GUI wrapper for the C++ compiler. There are many books and internet articles on this and on JNI. Use Google and you will find that many of your dreams will come true.
|
|
|
|
 |
|
 |
Thank you for your article, it's very helpful to beginners.
Based on your demo dll project, I added another ATL object, for example, a dialog with name CDlg. In the Dlg.cpp, I have to get access to the object of CSimpleCom, a pointer or reference to the object of CSimpleCom is required, I tried "_Module.GetModuleInstance()" to get the dll's instance handle, but I couldn't get any pointer or reference to the object of CSimpleCom using the module's instance handle. Vice versa, how to get a pointer or reference to the object of CDlg in SimpleCom.cpp?
Could anyone tell me how to resolve the problem? Thank you!
modified on Saturday, September 5, 2009 9:28 AM
|
|
|
|
 |
|
 |
Did you find any solution for this?
|
|
|
|
 |