|
Hi !
(Excuse-me, I hope that this message, will not be inserted inside the current discussion . I want to post a new message, a new discussion, but I don't know how to do.Here is my purpose)
I have developped a software which manage modem through serial
communications. That is why, I have imported the component MSComm32.ocx
in my application.
I have used .NET for my purpose . The installer application is
defined to register the component MScomm32 into the computer (A) on
which we make the installation. At this stage, there is no problem, the
installation of my application is successful. But when I launch my
application, there is a fail;
N.B. : The component MSComm32.ocx is inside the environnement Visal
Basic 6.0 , but not inside Visual Basic .NET developpement environment.
After the fail, I have installed VB 6.0 on the computer (A). And
now, the launch is successful. I have realized that, at run, the
component MSComm32.ocx refers another components (DLL), inside VB 6.0
So , my probelm I want to figure out is this : what are the satellite
components of MsComm32.ocx ? What am I going to do, to list all thise
components ?
|
|
|
|
|
Look in the module MSComm32.dep. It require comcat.dll and also optionally other components for support of languages other than english.
Since you are using the control in VB.NET you must also insure that the Interop assembly(s) for the control are also installed!
Hope this helps,
Robert
|
|
|
|
|
The version without popup window?
Thanks!
|
|
|
|
|
I want to write a simple XML editor with the help of MSXML. I'm using the library with smart pointers. I can read out the xml file and can display its structure within a treectrl, but I want to store a pointer to the specific element in the ItemData (DWORD) of the according treectrl item. What do I have to store (Interface*, IXMLDOMElementPtr) and how do I create the IXMLDomElement from that pointer? Do I have to care about releasing/allocating memory? Sorry for that silly question, but I don't have much experience with COM.
Thank you very much in advance,
Konrad
|
|
|
|
|
Does anyone know if it is possible to store a custom object inside a word document?
Let's say for example that I would like to save inside a word document the ID of the machine the document was created on. That information would be hidden from the user but stored inside the word document and could be retrieved programatically.
Help... Anyone?
Thanks,
Merlinos
|
|
|
|
|
Hi,
I hope this post belongs here...it seems to me to be some sort of COM issue, so here goes...
I have been working on a .NET add-in for Word 2003. I have created the project as a "Shared Add-in" according to this tutorial:
http://support.microsoft.com/kb/302896/EN-US/
My problem is that when I run the installer for this add-in on a machine other than the development machine it doesn't show up in Word.
The generated MyAddinSetup project doesn't seem to install the add-in correctly. I've tried both "For everyone" and "For this user only" to no avail.
I've also tried using regasm to register the .dll in the registry on the test machines, but nothing seems to work.
I've verified that both the Addin and the AddinSetup projects reference the Office 2003 PIAs; basically everything I've been able to pull up on the subject.
I've still yet to get this thing to run on any machine that doesn't have Visual Studio .NET 2003 installed. I have ensured that my test machines do have the .NET framework v1.1 installed, and that Office 2003 was installed with the .NET programmability feature enabled.
Has anyone had similar problems? Am I missing something obvious?
Any help is appreciated.
Thanks.
|
|
|
|
|
Hi m6reid,
Are you registering this add-in in restricted user mode on Win2K ?
Cheers,
Vishal
|
|
|
|
|
get the picture of the first page of MS Word doc, and save it to bmp?
|
|
|
|
|
The snapshot of the every office file's first page is stored in the form
of metafile inside some interface. Check IViewObject interface or search
the following newsgroup for extracting the metafile from the interface.
microsoft.public.win32.programmer.ole
Cheers,
Vishal
|
|
|
|
|
Hello , iam a new vc++ programmer,
I want to creaet an xml file using mxxml3.0
I had used every possible way 2 do that , every time
the functionc
CreateProcessingInstruction
&
raw_CreateProcessingInstruction
are throughing the run time exception.
plz help me i am trying 4 that since last 6 days. any sugestion would be helpful.
any place 2 find the proper code rather than msdn ,
i don't want 2use wrapper class 4 this.
Rahul Agarwal
|
|
|
|
|
I have a com server that mainly runs as embedded in main application. My main application is basically a mapping application that 'contains' these embedded servers. The servers basically manipulate the mapping data in their respective way. I am having a resource problem between my main application exe and one of my server exes during mouse movements. It seems that this particular server CPU starves my main application more than any other server during mouse movements. I came across the GetActivationPolicy on the IPointerInactive interface and COleControl class. Is there a way that I can modify the server to not utilize the CPU as much during mousemovements?
Any help is greatly appreciated -
|
|
|
|
|
You have meant to put this in, but where is CoInitialize()?
|
|
|
|
|
I have data in the form of an array, i want to display it to the user in tabular form in excel, allow the user to make modifications to it and again get the modified data back into the the original array in c++. i want some guidance on this, how to deal with the exporting to excel and how to import the data back to c++. i will highly appreciate your help if you provide me some snippets of code also,
Thanks a lot
|
|
|
|
|
Hello,
I´ve to transfer some VB code to C++. Now there is the following problem:
------------
Dim MediaEvent as HiPathProCenterLibrary.MediaEvent
Dim DeliveredEvent As HiPathProCenterLibrary.DeliveredEvent
...
<calling some="" methods="" of="" mediaevent="">
...
Set DeliveredEvent = MediaEvent
...
<calling some="" methods="" of="" deliveredevent="">
-------------
My problem is that I´ve no idea on how to cast (?) the MediaEvent to the DeliveredEvent (interfaces are not the same and none of them inherits it´s functionality of the other).
What is VB doing in this "Set Command"? What is the equal source code in C++?
Thank you for any help,
Stefan
|
|
|
|
|
I assume that MediaEvent and DeliveredEvent are COM interfaces.
To cast a COM interface from one interface into another use QueryInterface.
I.e.
void f(IMediaEvent * p)
{
if( p != NULL )
{
IDeliveredEvent * l_p(NULL);
HRESULT const l_hr(p->QueryInterface(
IID_IDeliveredEvent,
reinterpret_cast<void**>(&l_p)));
if( SUCCEEDED(l_hr) )
{
l_p->Release();
}
}
}
Using some sort of smart pointer (for instance CComQIPtr) is preferrable.
|
|
|
|
|
Thank you very much. It seems to work fine!
Stefan
|
|
|
|
|
Thanks for taking time to read this.
I have built a C# DLL full of business objects. Initially these objects were going to be used by a C# wizard only, but as development went on we determined that these objects and their methods could be used by an MFC DLL as well. I figured COM Interop...no problem.
Well I ran into problems after adding in all of the interfaces, adding a strong name to the DLL, creating a Type Library using the typexp.exe to create the type library and using regasm with the /codebase option to register the interfaces and coClasses.
The problems revolve around the client. The client trys to import the type library, generating the tli and tlh files. Inside of these files the GetType method defined by the base object in .NET has arguments of _Type and _TypePtr. The _Type and _TypePtr are not defined in any of the files that I can find.
I have a work around of substituting long for _Type and _TypePtr. Really since we are not calling GetType, I figured sc#$w it! Also since we are using interfaces here shouldn't GetType be banned from the interface. Everything compiled and ran.
I don't want to redefine the _TypePtr and _Type within the client as a long, nor do I want to have to parse through each tli and tlh file to substitute the hacked GetType method definition and declaration everytime I add to the type library.
Has anybody run into this problem before?
Is there a Header that I could add to the client to allow for the proper defninition of the _Type and _TypePtr?
Once again thanks for reading this.
All the best
Ward
Frag
Try, Fail..Fail, Succeed
Tool Developer
Michigan, USA
|
|
|
|
|
I have created solutions to these problems. If you would like the code please let me know.
Ward
;-D
Frag
Try, Fail..Fail, Succeed
Tool Developer
Michigan, USA
|
|
|
|
|
What did you change to accomodate this?
|
|
|
|
|
Hi all,
I have downloaded dsoframer.ocx ..... It is full of OLE / COM code. and i am newer to these interfaces and such activXcontrols.....
What i am doing.
i am trying to load office document ( from local file / from memory HGLOBAL ) into DsoFramer control placed in dialog based MFC application. Then after loading document , i want to disable keydown,on char,key up and right mouse button down. so that user cannt modify content. ( like viewer only.) I have debugged and put messagebox in source code but with no luck.
I want to know where can i handle such win messages.?
Does any other interface i need to add or implement?
I am able to get such message in CDsoFramerControl::ControlWindowProc() but when NO Document is loaded.? Why?
I have looked to windows with SPY++ i found that there are more windows handle underbeneth so is that i problem why i dont get any aforesaid messages.?
Any help is greatly appreciated.
Thank in advance.
Regards
Jetli
Jetli
conclusion means Coming to wrong Decision with confidence
|
|
|
|
|
Hi Jetli,
What you are missing here is OLE automation, once you have loaded the document inside DSOFramer activex control. You should query for IDispatch pointer of embeeded active document. Once you have IDispatch you can start automating that active document. (OLE automation is meaning the same, control the functionality of the application !)
hmmm... to disable the right click and typing etc see the methods expose by that active document IDispatch interface. You can use the utility provided by MS "OLE/COM Object Viewer" to see all the methods expose by the that application.
As I remember for "MS-Word" you can disable the typing using the "protect" method expose by word. And for right click search on "CommandBars".
I think its sufficient information !
Enjoy !
Cheers,
Vishal
|
|
|
|
|
Hi Vishal
Many thanks to you.
vishalmore wrote:
What you are missing here is OLE automation, once you have loaded the document inside DSOFramer activex control. You should query for IDispatch pointer of embeeded active document. Once you have IDispatch you can start automating that active document. (OLE automation is meaning the same, control the functionality of the application !)
above is new for me.... THANKS A LOT ... i have tried to get IDispatch and also played with some of methods by looking in OLE viewer. I would like to show how i have done this :
LPDISPATCH lpDisp = m_shControl.GetActiveDocument();<br />
DISPID dispid;<br />
OLECHAR FAR* szFunction;<br />
szFunction = OLESTR("Protect");<br />
DISPPARAMS dispparams;<br />
DISPID mydispid[1] = { DISP_PROPERTYPUT };<br />
VARIANTARG vararg[1];<br />
dispparams.rgvarg = vararg;
VariantInit(&dispparams.rgvarg[0]);<br />
dispparams.rgvarg[0].vt = VT_I4;
dispparams.rgvarg[0].iVal =2 ; <br />
dispparams.rgdispidNamedArgs = mydispid;
dispparams.cArgs = 1;
dispparams.cNamedArgs =1;
<br />
HRESULT hr = lpDisp->GetIDsOfNames (IID_NULL, &szFunction, 1, <br />
LOCALE_USER_DEFAULT, &dispid);<br />
<br />
hr = lpDisp->Invoke (dispid, IID_NULL, LOCALE_USER_DEFAULT,<br />
DISPATCH_METHOD, &dispparams, NULL, NULL, <br />
NULL);
"protect" property doesnot disable typing..
"Commandbars" is for toolbard floating in word window. ( which i can control via Dsoframer control.
Is there any property / suggestion for doing this?
Again Thanks In advance
Jetli
conclusion means Coming to wrong Decision with confidence
|
|
|
|
|
Hi Jetli,
Your code sounds gud to be gud to me.
Jetli Quoted :
"protect" property doesnot disable typing..
One possible mistake you have done is this
dispparams.rgvarg[0].iVal = 2 ;
It should be dispparams.rgvarg[0].lVal = 1 ;
You are saying that dispparams.rgvarg[0].vt = VT_I4; and storing short value in long ?
Well "Protect" method disables the typing in word document(I am very sure on this), have you check the return code in your automation routine for
"protect" method ?
Jetli Quoted :
"Commandbars" is for toolbard floating in word window. ( which i can control via Dsoframer control.
Is there any property / suggestion for doing this?
Word context menus are comes under the category of "CommandBars" only, you can disable the context menus in following manner ...
1.)Get IDispatch for embeeded Active Document.
2.)Ask IDispatch for DISPATCH_PROPERTYGET - "CommandBars", it will return disp ptr for CommandBars. This property takes one param i.e. nothing but id of that command bar (in word id for context menus starts from 38)
(you can use VBA to check the codes for these context menus for different office version )
3.)Now invoke the "Enabled" method using this disp ptr. This method takes 1 param of type BOOL.
My suggestion is that put all the above three steps in one for/while loop.
That's Context menus are disabled !
All the very best !
Cheers,
Vishal
|
|
|
|
|
Hi Vishal,
Many Thanks To You.....
But unfortunately i am still not able to do.... I need further help
I have done what u have said and tried things tooo .. but with no luck...
I have placed code as per your last reply...
>>One possible mistake you have done is this
>>dispparams.rgvarg[0].iVal = 2 ;
>>It should be dispparams.rgvarg[0].lVal = 1 ;
>>You are saying that dispparams.rgvarg[0].vt = VT_I4; and storing short value in long ?
i have corrected it......but still having same problem
// Again my revised code to look at
LPDISPATCH lpDisp = m_shControl.GetActiveDocument();
DISPID dispid;
OLECHAR FAR* szFunction;
szFunction = OLESTR("Protect");
DISPPARAMS dispparams;
DISPID mydispid = { DISPID_PROPERTYPUT };
// wdAllowOnlyComments=1// wdAllowOnlyRevisions=0,// wdAllowOnlyFormFields=2
//CComVariant vrProtecttionType((long)0);//1
VARIANTARG vararg[1];
dispparams.rgvarg = vararg; // 1-element array
VariantInit(&dispparams.rgvarg[0]);
dispparams.rgvarg[0].vt = VT_I4;
dispparams.rgvarg[0].lVal=1 ;
//dispparams.rgvarg=&vrProtecttionType ;
dispparams.cArgs=1;
dispparams.rgvarg=vararg ;
dispparams.cNamedArgs=1;
dispparams.rgdispidNamedArgs=&mydispid;
HRESULT hr = lpDisp->GetIDsOfNames (IID_NULL, &szFunction, 1,LOCALE_USER_DEFAULT, &dispid);
//dispid = 0x00000078
hr = lpDisp->Invoke (dispid, IID_NULL, LOCALE_USER_DEFAULT,
DISPATCH_PROPERTYPUT |DISPATCH_METHOD, &dispparams, NULL, NULL,
NULL);
//hr=0x80020005: Type Mismatch
>>have you check the return code in your automation routine for "protect" method ?
//hr=0x80020005: Type Mismatch
you can disable the context menus in following manner ...
>>1.)Get IDispatch for embeeded Active Document.
LPDISPATCH lpDisp = m_shControl.GetActiveDocument();
>>2.)Ask IDispatch for DISPATCH_PROPERTYGET - "CommandBars", it will return disp ptr for CommandBars. This property takes one
param i.e. nothing but id of that command bar (in word id for context menus starts from 38)
(you can use VBA to check the codes for these context menus for different office version )
DISPID dispid;
OLECHAR FAR* szFunction;
szFunction = OLESTR("CommandBars");
// parameter structure
DISPPARAMS dispparamsNoArgs = {NULL, NULL, 0, 0};
CComVariant vrTrue = (long)38;
dispparamsNoArgs.cArgs = 1;
dispparamsNoArgs.rgvarg = &vrTrue;
dispparamsNoArgs.cNamedArgs = 0;
dispparamsNoArgs.rgdispidNamedArgs = NULL;
HRESULT hr = lpDisp->GetIDsOfNames (IID_NULL, &szFunction, 1, LOCALE_USER_DEFAULT, &dispid);
//dispid 0x39
VARIANT vOut;
VariantInit(&vOut);
LPDISPATCH pCommandBarDispatch;
hr = lpDisp->Invoke (dispid, IID_NULL, LOCALE_USER_DEFAULT,
DISPATCH_PROPERTYGET, &dispparamsNoArgs, &vOut, NULL,
NULL);
//hr=S_OK
>>3.)Now invoke the "Enabled" method using this disp ptr. This method takes 1 param of type BOOL.
pCommandBarDispatch = vOut.pdispVal;
OLECHAR FAR* szStr;
szStr = OLESTR("Enabled");
DISPID dispid1;
hr = pCommandBarDispatch->GetIDsOfNames(IID_NULL,&szStr,1,LOCALE_USER_DEFAULT,&dispid1);
//dispid1=0x60040005
DISPPARAMS dispParams = { NULL, NULL, 0, 0 };
DISPID dispidNamed = DISPID_PROPERTYPUT;
//CComVariant vrId(VARIANT_FALSE); (also tried)
VARIANTARG vararg[1];
dispParams.rgvarg = vararg; // 1-element array
VariantInit(&dispParams.rgvarg[0]);
dispParams.rgvarg[0].vt = VT_BOOL;
dispParams.rgvarg[0].boolVal =VARIANT_FALSE;
dispParams.cArgs = 1;
dispParams.rgvarg = &vrId;
dispParams.cNamedArgs = 1;
dispParams.rgdispidNamedArgs = &dispidNamed;
hr = pCommandBarDispatch->Invoke(dispid,IID_NULL,LOCALE_USER_DEFAULT,DISPATCH_PROPERTYGET
|DISPATCH_METHOD,&dispparamsNoArgs,NULL,NULL,NULL);
// hr=0x80020003:Member Not found
Once Again Many thanks To You
Thanks In Advance...
Jetli
conclusion means Coming to wrong Decision with confidence
|
|
|
|
|
Hi Jetli,
hr = lpDisp->Invoke (dispid, IID_NULL, LOCALE_USER_DEFAULT,
DISPATCH_PROPERTYPUT | DISPATCH_METHOD, &dispparams, NULL, NULL, NULL);
Look at the code closly, the 4th parameter. It should be either
DISPATCH_PROPERTYPUT OR DISPATCH_METHOD OR DISPATCH_PROPERTYGET
In your case it should be DISPATCH_METHOD
One more sugestion you should always use the 2nd last parameter i.e EXCEPINFO. Its ease the life ...
Hope things are settled down ...
Cheers,
Vishal
|
|
|
|
|