|
Here you answer again
For that you have to write Winlogon Notification Package.
look for example here
http://www.codeproject.com/system/winlogon_notification_package.asp
"I Think this Will Help"
[Vote One Here,.....]
<h5
alok="" gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
|
|
Hello,
i develop a printerui dll, that based on the com-interface. My problem is, that the com-object the threat, that i startet, terminated.
What can i do, that this problem is gone.
Thanks.
- Sorry for my bad english.
|
|
|
|
|
I'm trying to use some Excel COM from Visual C++, but am having difficulty calling certain functions. For example, take the WorkSheets.Add method. The function declaration is as follows:
LPDISPATCH Add(const VARIANT& Before, const VARIANT& After, const VARIANT& Count, const VARIANT& Type);
By looking in the Excel VBA Help, I can get documentation for this method:
Add Method (Worksheets Collection)
Creates a new worksheet. The new worksheet becomes the active sheet. Returns a Worksheet object.
Syntax
expression.Add(Before, After, Count, Type)
expression Required. An expression that returns a Worksheets object.
Before Optional Variant. An object that specifies the sheet before which the new sheet is added.
After Optional Variant. An object that specifies the sheet after which the new sheet is added.
Count Optional Variant. The number of sheets to be added. The default value is one.
Type Optional Variant. The sheet type. Can be one of the following XlSheetType constants: xlWorksheet, xlExcel4MacroSheet, or xlExcel4IntlMacroSheet. The default value is xlWorksheet.
Remarks
If Before and After are both omitted, the new sheet is inserted before the active sheet.
OK, now for some example code. I can add a new worksheet quite easily using the following code:
COleVariant VOptional((long)DISP_E_PARAMNOTFOUND, VT_ERROR);<br />
ws.Add(VOptional, VOptional, VOptional, VOptional
The problem is that this default usage inserts the sheet before all current sheets in my workbook, but I want to insert it after all the other sheets. In Excel VBA, I can do this by simply running:
Worksheets.Add.Move after:=Worksheets(Worksheets.Count)
However, I'm having real trouble finding what the data type of the 'After' argument needs to be in C++ and I can't find any sample code anywhere! I have found hundreds of examples passing numbers or strings, but not objects! Can anyone supply some sample code?
Using the _Worksheet.Move method would also accomplish the same thing, but I have the same problem, so any help would be greatly appreciated!
|
|
|
|
|
Just in case anyone needs to do this, I figured out how to do it. The 'after' parameter needs to represent the IDispatch pointer of the worksheet you want to add the new sheet after. So you have to do something like this:
COleVariant var;<br />
var.vt = VT_DISPATCH | VT_BYREF;<br />
var.ppdispVal = &(objSheet.m_lpDispatch);<br />
<br />
sheet = objSheets.Add(VOptional, var, VOptional, VOptional);
In the above, objSheets is of type Workbooks and objsheet and sheet are of type _Worksheet
|
|
|
|
|
I have a windows service which creates another process after it is started. Now in the process that is created i create a COM object with an interface and few methods on it. Now if I run the Service with a Login I can access the interface of the COM object by regisrtering the interface in running object table and then getting it from there in the main service.
How ever if I run the servcie with LocalSystem account I cannot get the Interface pointer from the Running object table
What could be the problem? Is there another way of doing this
Thanks
Ravi
|
|
|
|
|
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
|
|
|
|