|
OK, so let's do our duty and inform everyone that I've found a solution to the problem. After posting the question on countless forums, sending e-mails to everybody I could find and even contacting Microsoft's support desk, I waited a week and a half with not so much as a "sorry, dude... you're on your own"!
Well, for the benifit of other poor souls who might run into the same problem and who can obviously not rely on the "gurus" on the forums: I have found the solution. It is a silly little quirk in Word which, according to Microsoft, is there by design. The fact that it is NOT there by design in all the other Office applications is beyond me, but there you have it.
For each CommandBarControl you HAVE to specify a unique value in its Tag property. Simple, heh?
Read all about it here: http://support.microsoft.com/kb/826931/EN-US/
Thanks for nothing, guys.
Johannes Ackermann
|
|
|
|
|
hi,
I want to simulate a new com server object on installation with the same binary. this means I have a com server as service e.g. MyServer.exe with interface IMyInterface. so I can access it with ProgID "MyServer.IMyInterface".
but I have to start up more instances and for this I want to rename the MyServer.exe to SecondServer.exe, register as service and now access it through ProgID "SecondServer.IMyInterface".
e.g.
MyServer.exe in c:\MyServer\MyServer.exe
SecondServer.exe in c:\SecondServer\SecondServer.exe
and calling
*CreateObject("MyServer.IMyInterface") should start up instance of MyServer
*CreateObject("SecondServer.IMyInterface") should start up instance of SecondServer
Now I need the registry entries com uses to create the object and I will give the SecondServer new uuid.
So in other words: which registry entries I have to change to redirect com to my new com server "SecondServer"?
greets&thx
|
|
|
|
|
Hello this question was raised by Bilal and i am also interested in getting its answer but no answer was posted before so putting it again.
"I am new to COM,OLE,AUTOMATION,ActiveX in Vc
so please provide me the difference among each as well as their purpose
Thanks "
or you can also provide me a link or document where i can find the diference
regards
Muhammad Azam
|
|
|
|
|
hi!
I want to capture the right mouse button event on MS Word document.
is it possible? if so then please help me.
Thanks
Ahmad Jalil Qarshi
|
|
|
|
|
Hi,
Yes you can, there r numerious ways to do this -
1. Write a plgin for word - for more info. search how to write plugin for
word
2. OLE Automation - If you r doing OLE embedding then get IDispatch, and
utilize the methods exposed by word. For more info. abt methods
expose by word, take the help from "OLE Object Viewer" to peep inside word
object
Cheers,
Vishal
|
|
|
|
|
hi!
I have Added a new CommandBarControl of type msoControlButton in the Menu "Inline Picture" (which is displayed when you right click on some picture or some OleObject in MS Word Document). I have also run some VBA macros on click event at this new inserted menu Item by specifying them into PutOnAction function. But now i want to call some functions of my ActiveX control's class when the user right click on my control and then select the newly inserted menu item. Is it possible if so then please help me.
Thanks
Ahmad Jalil Qarshi
|
|
|
|
|
Hello.
I am doing a research on DCOM, COM+ and .Net Remoting.
We are about to develop a license server which should communicate with all of our products (written in various languages)
I'd like to know what would be the best way to do this.
Should I use .Net Remoting? But i dont want the user to install .Net Framework if the product is written in C++.
Or would DCOM be a better solution? I heard that DCOM is a good choice in a situaltion like that?
And whats about COM+?
Maybe someone can give me some pres and cons just to get the right direction.
Thanx in advance
|
|
|
|
|
hi!
i have made a control for MS Word. Now when i insert the Control into the Word. InitNew methods is called, and when i save the document Save method of IPersistXXX is called but when i open my document the Load method of IPersistXXX is not called.
Furthermore, on reopening the document when i double click my control it displays the following message.
"This object was created in Properties.
This application is not availabe to open this object.
Make sure the application is properly installed and that it has not been deleted, moved, or renamed."
Please help me.
Thanks in advance.
Ahamd Jalil qarshi
|
|
|
|
|
When the document is opened, is an object of your type created at all? If not, I would inspect GetClassID() to see if the correct CLSID is returned.
--
My name in Katakana is ヨルゲン.
My name in German is Jörgen.
My name in Mandarin/Kanji is 乔尔根 西格瓦德森.
My name in Korean is 요르겐.
I blog too now[^]
|
|
|
|
|
Hi,
I have a MFC COM dll. when I tried to register this dll using regsvr32, I got error "DllRegisterServer entry point not found".
Can anyone help me out to know reason and solution...
thanks.
|
|
|
|
|
Check if you have properly exported "DllRegisterServer" function from your DLL.
You can check it using Depends.exe that accompanies Visual Studio.
This entry point (DllRegisterServer) is essential according to COM, for self registration of the COM Server implemented as a DLL.
Have a great day ahead!
Regards,
Sohail Kadiwala
(My Blog - http://blogs.wdevs.com/sohail/[^])
modified 21-Apr-21 21:01pm.
|
|
|
|
|
Hi,
I would like to call a dll functions from MATLAB, but unfortunately the dll doesn't export its functions as a
generic dll, so using the loadlibrary function from MATLAB doesn't work. the dll actually defines a class with all its >100 public functions available.
I thought an alternative way would be to wrap the library and provide a COM interface conveniently usable from MATLAB but I couldn't find a good example. So basically I would like to upgrade a dll with a COM interface by wrapping it.
Thank you in advance for your help, examples or thoughts
Shady
|
|
|
|
|
If it defines a class with functions available it sounds like it is already created as a COM dll.
|
|
|
|
|
Thank you for your reply,
Actually the dll class doesn't define a COM interface at all, but I am now thinking of making a simple COM object which would also have inheritance from the dll class it would then have both the COM and the dll methods
available not sure if this is OK though.
Shady
|
|
|
|
|
To make it completly clear the dll .h file looks like this:
typedef int (__stdcall *PConnect) ();
typedef int (__stdcall *PConnectSimple) (int lAnInterfaceType, char *pcAComName, int lABaudRate, BOOL bAShowProt);
typedef int (__stdcall *PConnectEx) (TLS_ControlInitPar *pAControlInitPar);
typedef int (__stdcall *PDisconnect) ();
typedef int (__stdcall *PLoadConfig) (char *pcFileName);
typedef int (__stdcall *PSaveConfig) (char *pcFileName);
......
class CLStep4
{
int m_DLLResultat;
HINSTANCE m_LStep4;
PConnect m_pConnect;
PConnectSimple m_pConnectSimple;
PConnectEx m_pConnectEx;
PDisconnect m_pDisconnect;
PLoadConfig m_pLoadConfig;
PSaveConfig m_pSaveConfig;
....
public:
CLStep4();
~CLStep4();
int GetDLLLoadResult() {return m_DLLResultat;};
int Connect ();
int ConnectSimple (int lAnInterfaceType, char *pcAComName, int lABaudRate, BOOL bAShowProt);
int ConnectEx (TLS_ControlInitPar *pAControlInitPar);
int Disconnect ();
int LoadConfig (char *pcFileName);
int SaveConfig (char *pcFileName);
......
};
|
|
|
|
|
hi
i want to read a binary file and store it into one of my activeX Control's
property. i used unsigned char * as the type of the property that will hold
the data read from file. but when it calls the
IPersistStreamInitImpl::Save(....) method. the data stored in the property
of type unsigned char * is not read, displaying in output window that
ATL: Invoked failed on DISPID 3
where DISPID 3 is id of that property. plz let me know which data type to
use? or where the actual problem lies.
Thanks in advance.
Ahmad Jalil Qarshi
|
|
|
|
|
hi,
I have a wee problem, Im using TypeLibInfo in VB .NET to expose
members of COM+/COM objects. So far so good as I have been able to do many things with it, The problem comes when trying to determine the member type
i.e if it is a function or property etc. as the TLI.MemberInfo.InvokeKind
is always comming back as unknown.
thoughts?
regards
charlie
|
|
|
|
|
hi dears,
i want to write a program which can add a button in the toolbar of ms outlook. can someone help me to accomplish this task. can i do this in vb6. i shall be very thankful.
|
|
|
|
|
Hi,
There are a lot of articles on how to accomplish this. I have even managed to do it with Delphi. As long as you can create a dll you should be fine, so if you can do some code translation you should really check out this article:
http://www.codeproject.com/com/outlookaddin.asp[^]
This one is for VC++, but the principle is the same. On MSDN you will also find a lot of information, but the articles there usually refer to VS.NET and tools that come with it. If you want to right an add-in from scratch the article above will be a good place to start.
Johannes Ackermann
|
|
|
|
|
Is it possible to do exactly a client does when it releases a COM object, but from the server?
|
|
|
|
|
hi!
I want to insert an object into MS Word using function AddOleObject. i did it using visual basic 6 using the following function.
InlineShape.AddOleObject(insRange,"{7A4960FC-645E-4971-B2C4-E4C3DB896D10}","",False,False);
where insRange is of Range type. it worked fine. but the problem is that i want to do it in Visual C++6. Now the function prototype in VC++6 is hereunder
MSWord::InlineShapes::AddOLEObject ( VARIANT * ClassType, VARIANT * FileName, VARIANT * LinkToFile, VARIANT * DisplayAsIcon, VARIANT * IconFileName, VARIANT * IconIndex, VARIANT * IconLabel, VARIANT * Range )
i am a bit confused about how to use this function in VC. I tried it using following code.
VARIANT varClassType; VariantInit(&varClassType);
VARIANT varLinkToFile; VariantInit(&varLinkToFile);
VARIANT varDisplayAsIcon; VariantInit(&varDisplayAsIcon);
VARIANT varEmpty; VariantInit(&varEmpty);
VARIANT range; VariantInit(&range);
varClassType.vt = VT_BSTR;
varLinkToFile.vt = VT_BOOL;
varDisplayAsIcon.vt = VT_BOOL;
range.vt = VT_I4;
_bstr_t clsID = "{7A4960FC-645E-4971-B2C4-E4C3DB896D10}";
varClassType.bstrVal = clsID.copy();
varLinkToFile.boolVal = FALSE;
varDisplayAsIcon.boolVal = FALSE;
varEmpty.vt = VT_EMPTY;
range.lVal = 0;
MSWord::InlineShapePtr SigObj = m_pWordApp->ActiveDocument->InlineShapes->AddOLEObject(&varClassType, &varEmpty, &varLinkToFile,&varDisplayAsIcon,&varEmpty, &varEmpty,&varEmpty,&range);
but unfortunately when last line of above code executes my program crashes. i think that the problem is with my first and last parameter in the AddOleObject function. I dont know how to resolve it.
Please help me.
Thanks
|
|
|
|
|
Months ago I was doing a similar type of program, except that it was coded in C++ .NET and used COM Interop.
As I recall, the difficulty was with the VARIANT type, which can be just about anything in COM, but, has no counterpart in the CLR.
Your problem is similar; you have to use the VARIANT type in C++ (there is no natural type in C++ that would be equivalent).
I couldn't figure it out either, but, I'm fairly sure it would involve writing some kind of elaborate series of marshaling functions to structure the data correctly in memory so that COM can understand it.
|
|
|
|
|
Thanks Ursus Zeta!
the thing is that i have also tried to use this function in VC7.1 using COM. but it didn't work out. you can see from my previous post that i have used the VARIANT datatype. but don't know wht's happening. The Error indicates that there is a type mismatch. I am very upset about it. coz i have tried all the datatypes in the VARIANT type.
|
|
|
|
|
i have solved the problem using CComVariant in place of VARIANT.
i replaced the code in my first post with following 2 lines and it worked fine.
CComVariant varClsType("Ascertia.AscertiaObj.1");
MSWord::InlineShapePtr SigObj = m_pWordApp->Selection->InlineShapes->AddOLEObject(&varClsType);
|
|
|
|
|
hi all
can anybody tell me whr i can get the file formats of audio media file like
M4A
MP4
M4B
M4P
LA1
LQT
AAC
MND
MMZ
PCA
RM
RAM
RMX
RAX
so as to identify them.
and also the source code in MFC/SDK to convert them to WMA.
thanx in Advance
SUMIT
sumit kedia
sumitpkedia@yahoo.co.in
|
|
|
|