|
Hi,
At step 10 you clearly show the way of how to add the method for interface, any tips for if want the returned type of a object which is created in the project or use a object parameter?
For example: there is a class called User in the project something like
Class User
{}
then add a method for interface with something like User GetUser()
or void AddUser(User u)
Thanks in advance
|
|
|
|
|
Peng wrote: void AddUser(User u)
use pointer to pointer, as object is going to created in dll, when returning from the interface and pointer, in when setting value in dll.
i.e. void GetUser([out,retval]USER ** pUser);
void SetUser([in]USER* pUser);
ok!
|
|
|
|
|
Thank you.
The reason I posted question is that when I tried to use object parameter, I got error says "error MIDL2025 : syntax error : expecting a type specification near "User" that pointing to the idl file where the code [id(1), helpstring("method GetUser")] HRESULT GetUser(User ** u); and couldn't figure out what was the problem. Any tips to this error?
Thanks again.
|
|
|
|
|
Peng wrote: HRESULT GetUser(User ** u); and couldn't figure out what was the problem. Any tips to this error?
where you User defined class USER ??, you have to define same as interface in IDL if you want to use it!
"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/codeProject$$>
|
|
|
|
|
The USER is a class I have in the project. How can I define it as interface in the IDL in order to be able use it?
or I will need to create an ATL object USER instead of this class object USER?
Thanks
|
|
|
|
|
Peng wrote: I will need to create an ATL object USER instead of this class object USER?
yes you have to create the ATL object of USER, in order to make it language independent!
"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/codeProject$$>
|
|
|
|
|
Hi,
Any suggestion for a sample COM project with event, should I choose the ATL/COM or MFC dll or else with I start it with vc6.
Thanks in advance.
|
|
|
|
|
|
If I want to create a test project for the ATL dll and put it within the same workgroud with dll project in order to be able to debug, test and also step into the dll code easier instead of a external program. Any suggestions with how to do it?
Thanks a lot.
|
|
|
|
|
add the test project in the solution itself rather creating new solution files!, or press f5 from the dll code itself or attach it with running process
"If it were machines, the pair_programming seem to work, but for humans it is pair_crackdown that seems to work! " - Nisamudheen
"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 Alok. Since I am a new to this area, could you give me some more details.
I added a test project in the dll workspace, but having difficult to reference the dll from the test project.
Thanks again.
|
|
|
|
|
Peng wrote: I added a test project in the dll workspace, but having difficult to reference the dll from the test project.
for referencing you have to import that dll in your test project, try #import "DLLNAME"
"If it were machines, the pair_programming seem to work, but for humans it is pair_crackdown that seems to work! " - Nisamudheen
"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,
I am trying to follow the example by creating a test project, I first followed atl/com wizard to create a test.cpp file, the wizard generated and file that includes a line of code #include "test_i.c", and then before I go any further an error says "fatal error C1083: Cannot open include file: 'test_i.c': No such file or directory
Error executing cl.exe" while I try to compile it.
Any ideas about this error?
Thanks in advance.
|
|
|
|
|
try rebuild all
"If it were machines, the pair_programming seem to work, but for humans it is pair_crackdown that seems to work! " - Nisamudheen
"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
|
|
|
|
|
Figured it out, had to compile .idl file first.
|
|
|
|
|
That's why i told you to rebuild...\
please vote for article,
Thanks
"If it were machines, the pair_programming seem to work, but for humans it is pair_crackdown that seems to work! " - Nisamudheen
"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 opened a new project, as you suggested tried to rebuild all but getting
fatal error LNK1103: debugging information corrupt; recompile module
Error executing link.exe.
Any ideas?
Thanks
|
|
|
|
|
can someone tell me , why we need to Fire_TotalMarks () ?
my application works without it ...:->
|
|
|
|
|
PerryJoe wrote: , why we need to Fire_TotalMarks () ?
my application works without it ...
How your application getting event notification!
"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 followed the steps as you shown.
but when i was including "this->Fire_TotalMarks(this->m_iTotalMarks);" in my code . there was some error of no definition found [the error was correct as there was a no such declaration/defn of method].
then i tried to remove that line and run my application.
and it was running ..
i dont know how i am getting event notification as i am new to this environment.
[ this may be the case as i am using VS 2005].
Thanks for the giving simple way of creating ATL COM application.
|
|
|
|
|
I have created a sample ATL dll same as the one in this article to work with vc++ client. and it works fine.
I created an object as
ISimpleObjPtr sObj("SimpleComAtl.SimpleObj");
in a win32 console application, can you tell me how to set the handler for the event fired on Calculate?
thank you.
-- modified at 8:54 Thursday 30th August, 2007
|
|
|
|
|
invinJerry wrote: in a win32 console application, can you tell me how to set the handler for the event fired on Calculate?
http://www.codeproject.com/com/TEventHandler.asp[^]
"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
|
|
|
|
|
hai,
this is a very good article..thanks.
Iam developing an IE toolbar in VC++ 6.0 ATL COM . my toolbar looks only in classic style .I wanted to get it in XP style. I tried many things, but still no success. I used manifest files and did things explained in http://www.codeproject.com/w2k/xptheme.asp. Please give help..
IE toolbar help
|
|
|
|
|
I followed ur article..
and developed a ATL project.. in VS2005
that fires an event as ur Totalmarks using Fire_Totalmarks.
i need to use activeX object in Javascript
I called this activeX from javascript..
properties and function calles are doing fine..
but event does not work... either it is not invoked or caught
then i used ur SimpleAtlCom ATL project.. ..
but i didnt work too..
is there a problem in my javascript code.. or .. developing ATL project...??
Here is the activeX object declaration and event handle
alert('here');
<object id="SIMPLE" classid="clsid:{27BF0027-BECC-4847-AF91-99652BCE9791}">
-- Nahian
-- modified at 0:29 Monday 16th July, 2007
|
|
|
|
|
i have know idea about javascript so can't help!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief
|
|
|
|