|
hi alok,,
I just solved my problem ..
Infact I started with the wrong step..
I got it solved From this very USEFUL Link...
http://support.microsoft.com/default.aspx?scid=kb;en-us;288156
i was not aware of step NO. 3,4,5 in the above LinK..
Guess what i just created the event sync to respond on a message arrival in Exchange Store....
Thank you For Giving Suggestion & your time..
Bye
<
|
|
|
|
|
Yeah Sure! thanks for informing about that link!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
Hi,
I have got linking error when trying to build the SimpleAtlCom dll project
downloaded from this web page.
No modification to the source code have been done.
I'm using VC 6++ running on XP SP2.
The linking error are as follows:
Configuration: SimpleAtlCom - Win32 Unicode Release MinDependency--------------------
Linking...
Creating library ReleaseUMinDependency/SimpleAtlCom.lib and object ReleaseUMinDependency/SimpleAtlCom.exp
LIBCMT.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
ReleaseUMinDependency/SimpleAtlCom.dll : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
SimpleAtlCom.dll - 2 error(s), 0 warning(s)
Any help is appreciated.
Noam1
|
|
|
|
|
Actually the cause of linking error is Symbol _ATL_MIN_CRT ,which is defined in Win32 ReleaseUMinDependency configuartion.
you have many option to remove this linking error,i am stating some of them
- remove the symbol
_ATL_MIN_CRT from PROJECT|Setting|C/C++|Preprocessor Definations
- or build you DLL in Release Min Size or MinDependency ,as i already have removed that symbol.
|
|
|
|
|
hi alok i was trying to make simpleatlcom.dll with ur exemple
i get following errors are these due to some settings which i have not done
help me
thanks in advance
: error C2511: 'get_Name' : overloaded member function 'long (unsigned short ** )' not found in 'Csimpleobj'
c:\program files\microsoft visual studio\myprojects\simpleatlcom\simpleobj.h(10) : see declaration of 'Csimpleobj'
C:\Program Files\Microsoft Visual Studio\MyProjects\simpleatlcom\simpleobj.cpp(20) : error C2511: 'put_Name' : overloaded member function 'long (unsigned short *)' not found in 'Csimpleobj'
c:\program files\microsoft visual studio\myprojects\simpleatlcom\simpleobj.h(10) : see declaration of 'Csimpleobj'
Generating Code...
Ankit Aneja
|
|
|
|
|
Do u used the Code given in Sample or Created your own.
if you created Your Own code ,do you please Share that
thanks
"I Think this Will Help"
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
ya i am sending u the code is is same what u give in example
STDMETHODIMP Csimpleobj::get_Name(BSTR *pVal)
{
// TODO: Add your implementation code here
CComBSTR bstStr(this->name);
*pVal=bstStr.Detach();
return S_OK;
}
STDMETHODIMP Csimpleobj::put_Name(BSTR newVal)
{
// TODO: Add your implementation code here
::wcstombs(this->name,newVal,99);
return S_OK;
}
STDMETHODIMP Csimpleobj::get_ATLMarks(short *pVal)
{
// TODO: Add your implementation code here
*pVal=this->ALTMarks;
return S_OK;
}
STDMETHODIMP Csimpleobj::put_ATLMarks(short newVal)
{
// TODO: Add your implementation code here
this->ALTMarks=newVal;
return S_OK;
}
STDMETHODIMP Csimpleobj::get_COMMarks(short *pVal)
{
// TODO: Add your implementation code here
*pVal=this->COMMarks;
return S_OK;
}
STDMETHODIMP Csimpleobj::put_COMMarks(short newVal)
{
// TODO: Add your implementation code here
this->COMMarks=newVal;
return S_OK;
}
STDMETHODIMP Csimpleobj::get_Total(short *pVal)
{
// TODO: Add your implementation code here
*pVal=this->m_iTotalMarks;
return S_OK;
}
STDMETHODIMP Csimpleobj::Calculate()
{
// TODO: Add your implementation code here
this->m_iTotalMarks=this->ALTMarks+this->COMMarks;
return S_OK;
}
Ankit Aneja
|
|
|
|
|
In first Post you mentioned your function of type as compiler error state
get_Name(short*); '
but here you mentioning parameter in get_name(BSTR)
I think there is Problem in Function Decalaration could you check and tell it to me.
Thanks
"I Think this Will Help"
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
yes i first declared it short
and after that i changed it to BSTR
i think i haven't changed it, in all places
Ankit Aneja
|
|
|
|
|
Hello,
The article is very useful and well done!Thanks to ThatsAlok.
I'm a beginner in COM programming and need a little help.I made a VC++ mfc dialog-based application that acts as a client. I want to handle the event from the COM server, but I don't know how it is made in VC++. Any help appreciated.
Thanks in advance.
|
|
|
|
|
For handling Event, Mr Lim Bio Long has written a custom Template class .
you can find it here
http://www.codeproject.com/com/TEventHandler.asp
I am also working for VC++ based Event for this project.Will try to update this article soon.
G.A. wrote:
The article is very useful and well done!Thanks to ThatsAlok.
Thanks to u too!
"I Think this Will Help"
Alok Gupta visit me at http://www.thisisalok.tk
|
|
|
|
|
Thank you Alok,
very fast answer - you are great
|
|
|
|
|
G.A. wrote:
Thank you Alok,
Mention Not Sir!
G.A. wrote:
you are great
NO!!!,God is Great , i am just his servent
"I Think this Will Help"
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
how to export a atl class from atl dll?
Can i just add the attribute "extern __declspec( dllexport )" to my ATL class.
waiting for ur replies
Karthik
|
|
|
|
|
|
Hello,
Thanks you for your help but:
I Want to give my dll file to a friend so:
HE WANTS TO #IMPORT THIS DLL ONLY.NOT ANT OTHER FILE.
Best Wishes,
Thank you.
|
|
|
|
|
can you export .tlb file?
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Hello again,
I want to use my dll file only.
Like this:
#import "SimpleAtlCom.dll"
CSimpleObj sth;
sth....
Best Wishes,
Thanks.
|
|
|
|
|
Hian here is the Way to achieve that, i am sorry for being LATE,actually i myself don't Know how to achieve that,but i ahve learned that and here your Answer
#import "D:\alok\TestProject\SimpleAtlCom\Debug\SimpleAtlCom.dll" rename_namespace("Simple")
you got the all interface underNAMESPACE Simple
then to make it public usable
using namespace Simple;
then you will see after importing the dll, SimpleAtlCom.tlh file is created in your debug or Relase library. you project will work fine even if you don't includ ethat file in you project but if you include it the Visual C++ Smart Help can give you option
#include "debug\simpleatlcom.tlh"
Now how to use them
here is little code that can help
ISimpleObj *iObj;
::CoInitialize(NULL);
HRESULT hr=::CoCreateInstance(__uuidof(SimpleObj),NULL,CLSCTX_ALL,__uuidof(ISimpleObj),reinterpret_cast<LPVOID*>(&iObj));
if(FAILED(hr))
{
MessageBox("Interface pointer failed");
return;
}
iObj->put_ATLMarks(100);
iObj->put_COMMarks(100);
iObj->Calculate();
CString str;
short Marks;
iObj->get_Total(&Marks);
str.Format("%d",Marks);
MessageBox(str,"total Marks");
I hope this will help you out from your problem
-----------------------------
"I Think this Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Is there a way to import dll's such as in this example into an idl file so that one could use the interfaces defined in the dll in one's own interface.
Example:
[
object,
uuid(...),
version(1.0),
pointer_default( ref )
]
interface IUsesSimple : IUnknown
{
[id(0x00000001)]
HRESULT GetSimpleInterface( [out, return] Simple::ISimple * pSimple );
};
Thanks!
|
|
|
|
|
Yeah very Much Possible ,but instead of this
Anonymous wrote:
HRESULT GetSimpleInterface( [out, return] Simple::ISimple * pSimple );
EASY Option
use this
HRESULT GetSimpleInterface( [out, return] IDispatch* pSimple );
or
HRESULT GetSimpleInterface( [out, return] VARIANT* pSimple );
Little Typical and I never used that
Import the tlb file of SimpleDll in your IDL file and proceed as you quote
"I Think this Will Help"
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
Sorry for Last Time,I am Just Kidding,I have created a sample Project for you problem.
if you need Source Code,send me you email id i will send it to you.
and anyway IDL look somethng like this
import "SimpleAtlCom.idl";
[
object,
uuid(7B533AFD-9748-4E34-933D-3D549346C412),
dual,
helpstring("IUseSimple Interface"),
pointer_default(unique)
]
interface IUseSimple : IDispatch
{
[id(1), helpstring("method GetInterface")] HRESULT GetInterface([out,retval]ISimpleObj **ppNewSimpleObj);
};
[
uuid(6A1D33D7-F2E7-4158-BB0F-42B32E284909),
version(1.0),
helpstring("IUsesSimple 1.0 Type Library")
]
library IUSESSIMPLELib
{
importlib("stdole32.tlb");
importlib("stdole2.tlb");
[
uuid(07C75ABC-8307-49AE-9E78-B20BBA21D7CA),
helpstring("UseSimple Class")
]
coclass UseSimple
{
[default] interface IUseSimple;
};
};
Thanks
"I Think this Will Help"
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
Hello,
I read this article and learn very new things,
I am a beginner and want to use this DLL in
My mfc app.
After I #import this dll what should I do?
Please Help me.
Best Wishes,
Thanks.
|
|
|
|
|
Hi Solium,
Here is your Explantion,there are two way to use the com DLL in your vc++ project
either Including .TLB file that with #import directive, in that you have to use IDispatch in every case.
or using real interface of the COM DLL,doing second one is real nice. here i explantion how to use it in vc++.
1.First Create,Compile and build the SimpleAtlCom.dll
2.copy SimpleAtlCom.h,simpleAtlcom_i.c and simpleAtlcom_p.c in your project directory
3.include SimpleAtlCom.h in your project.
4.now here is small code that will assist you
//put atl marks in component
void func()<br />
{<br />
CString Str;<br />
::CoInitialize(NULL);<br />
<br />
ISimpleObj *SimpleObj;<br />
HRESULT hr;<br />
<br />
if((hr=CoCreateInstance(__uuidof(SimpleObj),NULL,CLSCTX_ALL,__uuidof(ISimpleObj),(LPVOID*)(&SimpleObj)))!=S_OK)<br />
{<br />
Str.Format("error no : %u",hr);<br />
MessageBox("error creating Object",Str);<br />
}<br />
<br />
if(SimpleObj)<br />
{<br />
SimpleObj->put_ATLMarks(100);<br />
SimpleObj->put_COMMarks(200);<br />
<br />
SimpleObj->Calculate();<br />
<br />
<br />
short pVal;<br />
SimpleObj->get_Total(&pVal);<br />
<br />
<br />
Str.Format("%d",pVal);<br />
MessageBox(Str);<br />
}<br />
<br />
:: CoUninitialize();<br />
}
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
I hasn't recieved any feedback on article,is article is lack something or it too good to be comment out .
Actually commenting,Force author to write his/her article more user friendly
Thanks
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|