|
CoRegisterClassObject "Registers an EXE class object with OLE so other applications can connect to it. EXE object applications should call CoRegisterClassObject on startup. It can also be used to register internal objects for use by the same EXE or other code (such as DLLs) that the EXE uses."
CLSCTX_INPROC_SERVER could be used to register an object for internal use by an executable.
Ian Mariano - Bliki | Blog
"We are all wave equations in the information matrix of the universe" - me
|
|
|
|
|
thanks, ian.
I am a new COM guy, but I think I can not find the answer anywhere in
1. Inside COM, MS Press
2. Inside DCOM, MS Press
3. ATL Internal, Addison-Wesley
4. Inside COM+, MS Press
5. Inside ATL, MS Press
6. COM+ Programming: A Practical Guide Using Visual C++ and ATL, Pretice
May I ask where I can find an example of this kind of usage? Thanks again. COM Guru.
|
|
|
|
|
You'd basically create such an object the same way you do any normal COM object, using CoCreateInstance. There's a small simple ATL COM example on CodeGuru. Google's also a good place to start.
Ian Mariano - Bliki | Blog
"We are all wave equations in the information matrix of the universe" - me
|
|
|
|
|
Hello,
The original program(OLE Automation server) was impemented on Borland Delphi. But the program don't register itself in ROT during start-up(ie program don't call RegisterActiveObject()).
- How can I connect to the running instance of the program?
I can get PID from processes list. Can I some how use that for inquiering the interface pointer(IDispatch)?
Thanks for any suggestions.
|
|
|
|
|
Dear sir !
+. How can I initialize tapiFax
+. Tapi3.x which is support send/recevice Fax ?
+. Please help me
|
|
|
|
|
It's possible to use LoadLibrary() and GetProcAddress("DllGetClassObject") on a DLL in order to obtain a ClassFactory. You can then use the ClassFactory to create a COM object.
Is there is an equivalent technique that can be used for an EXE?
That is, can I create a COM object from a nominated instance of an EXE?
Thanks in advance.
|
|
|
|
|
Hi,
I have a function that passes the following arguments:
void SignOn(BSTR* Name, BSTR* Password, BOOL* UseProxy, BSTR*
ProxyServer, short* ProxyPort);.
I declared the following variables which I pass to the function
BSTR Name = ::SysAllocString(L"coinpig");
BSTR Password = ::SysAllocString(L"aug2203");
BOOL useproxy = 0;
BSTR proxyServer = ::SysAllocString(L"0");
short ProxyPort = 0;
short * strPortptr = &ProxyPort;
When I use the active-x control test container and specify that all
values are BSTR the function works properly. When I call the function
with the variables I declared, the program exits with code 3. I am
new to MFC, and greatly appreciate any help.
Thank you,
Tom
|
|
|
|
|
How are you calling the SignOn function in your code?
To call SignOn with the variables you have created and the function prototype you have given:
<code>
SignOn(&Name, &Password, &useProxy, &proxyServer, strPortptr);
Or you could prototype your function like:
<code>
void SignOn(BSTR Name, BSTR Password, BOOL UseProxy, BSTR ProxyServer, short ProxyPort);
and then call the function:
<code>
SignOn(Name, Password, UseProxy, ProxyServer, ProxyPort)
The only difference between the two: the former uses pointers as parameters, whereas the latter does not.
I prefer the second approach unless I need to logically change the value of more than one variable in which case I would change my parameters to use pointers. Functions can only have one physical return value.
Hope this helps!
|
|
|
|
|
HI..i am a newbie in COM tech.
i have a class coded in VC++ which i need to create into a COM for use in my vb.net application..
i have use a ATL COM Appwizard to create a com. add a new atl object already.
i keep getting this error.
i need to pass in a parameter to the constructor of the class i created..seems like i cannot instaniate my object.
c:\program files\microsoft visual studio\vc98\atl\include\atlcom.h(1827) : error C2259: 'CComObject<class ctranscodeengine="">' : cannot instantiate abstract class due to following members:
c:\program files\microsoft visual studio\vc98\atl\include\atlcom.h(1823) : while compiling class-template member function 'long __stdcall ATL::CComCreator<class atl::ccomobject<class="" ctranscodeengine=""> >::CreateInstance(void *,const struct _G UID &,void ** )'
PLS help...
thks in advance...
iceman
|
|
|
|
|
Hi,
I’m developing an ActiveX-control in VS C++ 6.0 (WinXP): works fine.
For deployment, I’m using VS.NET for making the Cab-file (New project: Cab
Project). Adds ocx and builds Cab: works fine.
Problem: The .ocx is depending on 2 other dlls, as it is now they are downloaded and registered manually: this works some times, some times it is "Dll Hell".... "Dll hell" occurs when updating ocx and dlls.... is there any way to force registration and so on? My belive is that it will work fine if I just adds the dll to the Cab File-project, could that be right? If so, how do I do it in VS.NET (I know how to add the files, but it’s not working when adding the depending dlls)?
I’m also a bit confused of the making of the Cab File, with VS.NET (Cab Project, OSD-file) it’s easy, but I don’t know what I’m doing... old tech, with INF-file, it was harder, but more open I guess?
Which is the best solution in my case?
...and justice for all
APe
|
|
|
|
|
HI,
I need to implemnent span tag style(overline etc) in vc++ can anyone help me out... plz thanx....
Helping hands are greater than praying lips
lokesh
|
|
|
|
|
Hi Lokesh,
Not too sure what you are after but here I've done an example that may be what you are looking for:
MSHTML::IHTMLDocument2Ptr spDoc(m_ctlWeb1.GetDocument());
if (spDoc)
{
MSHTML::IHTMLDocument3Ptr spDoc3 = spDoc;
if (spDoc3)
{
MSHTML::IHTMLElementPtr spElem = spDoc3->getElementById(_bstr_t("idSpan1"));
if (spElem)
{
spElem->innerText = _bstr_t("Hello There");
MSHTML::IHTMLStylePtr spElemStyle = spElem->style;
if (spElemStyle)
{
spElemStyle->textDecorationOverline = true;
}
}
}
}
So in the code above we look for an element called 'idSpan1', set the text, and then set the text decoration style to be Overline. Hope this is near the mark.
For further style information go to MSDN and look at the following interfaces:
IHTMLStyle
IHTMLStyle2
IHTMLStyle3
IHTMLStyle4
Hope this helps,
Andy
|
|
|
|
|
Hello everybody,
I am a beginner in com programming, and i have a question:
I have created an ATL 3.0 project including a simple object named MyObj with the attribute of 'appobject' on it's coclass. It has a property named MyString that holds string values. I have successfully built it and then tested it from vb. I have access to MyString property directly without instantiating MyObj. everythings is Ok.
but I have problem with VC. From a Console application which has access to that type library (via import directive) MyString property cannot be accessed without qualification. With the statement:
MyString = "Hello world!";
compiler generates following error:
error C2065: 'MyString' : undeclared identifier
what is the problem? do you think i should use a special syntax?
if so, would you please help me to know how i can use it?
thanks in advance
Roozbeh
|
|
|
|
|
Hi,
Not to sure why you are getting a problem.
Here is an example of how to use it in VC++ (see if it differs to yours)
First, the #import
#import "D:\My Projects\C++\MyObj\MyObj.tlb"
using namespace MyObjLib;
Add the namespace to avoid any conflicts with other COM objects you may use that will have the same name.
Now when using it:
MyObjLib::IMyObjPtr pMyObj = NULL;
try
{
if (SUCCEEDED(pMyObj.CreateInstance(__uuidof(MyObjLib::MyObj))) && pMyObj != NULL)
{
pMyObj->MyString = _T("Hello");
}
}
catch(_com_error &e)
{
}
This ultimately will use the wrapper method PutMyString( _bstr_t pVal ) that is defined in the two new files generated by the #import statement.
These should be in your Debug/Release directories and called MyObj.tlh and MyObj.tli. Ones the header file, the other the implementation file.
Have a look through them to see how your COM object has been wrapped.
Hope this has helped,
Andy
|
|
|
|
|
I'm trying to automate PowerPoint from an MFC application. When I import office TypeLib (from Add MFC Class from Typelib), VS generates these wrappers for the COM calls.
How would one find out what different classes and methods do? Certainly wrappers are not documented in MSDN, and I don't know how to get to the actual COM interfaces being used.
btw I'm using VS.NET 2003 and Office 2003
|
|
|
|
|
You can use the "OLE/COM Object Viewer" accessible
from the Studio .net Tools menu.
open up the tool from the "Tools | OLE/COM Object Viewer" menu
selection and browse to the Microsoft Powerpoint x.xObject Library
in the left hand tree view. the right hand pane should fill up with
registration information. doiuble click in the left hand treeview
on the power point text and it will open the type library definition
(methods, etc..) for the ppt object model.
-
you can also run Powerpoint and select Tools | Macro | Visual Basic Editor
to bring up VBA editor (you must have a presentation open, btw). Then press F2 key to run the object browser
which shows all the methods for the powerpoint library and other
referenced libraries.
--
hope this help..
steve
sas
|
|
|
|
|
and try this link to microsoft's docs...
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/modcore/html/deovrMicrosoftPowerPoint2000.asp
sas
|
|
|
|
|
Thanks.
I'm gonna try this and see how it goes.
|
|
|
|
|
MS Office actually comes with VB help in the form of .chm files although they are pretty well hidden. The path varies slightly from version to version but if you look around:
C:\Program Files\Microsoft Office\Office10\1033
(the 1033 is the important bit), you should see a bunch of .chm files. These will give you information on the various methods. It's not perfect, but it does help.
There is quite a bit of KB documentation on MSDN, lookup "Office Automation".
|
|
|
|
|
Yeah, I've seen the chm files, but they cover VB only. It is suprising, the lack of MFC samples.
Thanks anyway.
|
|
|
|
|
Hi,
I need to pass an array to a method in a com interface using variants. can anyone help me. i need to do in C++.
|
|
|
|
|
Hi,
Do a search on the sites for SAFEARRAY (or if you're using ATL try CComSafeArray)
Hope this helps,
Andy
|
|
|
|
|
Could someone in simple terms, explain Interface hooking using a COM component like MSN Messenger for example. What are the advantages of using COM interface hooking?
cheers
mike
|
|
|
|
|
|
if i want to implement a firewall with windows apis for
processing each input/output packet please introduce me that apis (if there is)
koosha
|
|
|
|