|
Hello Everybody,
I have basic query regarding ClassFactory.
As we know ClassFactory creates the components.
Clients call CoGetClassObject which calls DllGetClassObject,
which creates ClassFactory and returns an IclassFactory pointer,
Now my doubt is what if DllgetClassObject creates the component directly,
and return the required interface from the component.
Why we need to have a classfactory, why can't we directly create the compnent in DllGetClassObject.
Waiting for your response.
Thanks,
Shyam
|
|
|
|
|
Hi all,
I want to call an exe from my .net application using form's Showdialog() method.The control is moving to the caller successfully. but while closing that application i want to get the the result of database operation [The Result is like 1 for success and any other string for failure].
How can i achieve?
thanks in advance
Sri
|
|
|
|
|
I have developed COM add-in for microsoft word.I am handling events of microsoft word like DocumentOpen, DocumentBeforeSave. In Open / save events, I am getting the content of an active document. But I am getting only text or only image or only tables at a time.
How to retrieve byte array pointer to the word document entire content irrespective of data type (image, string, and table).
Vijit P
|
|
|
|
|
Greetings!
What i am trying to do is to access the IDropTarget interface of another process. I have dug into this and have found out -and of course, correct me at any time if i am wrong- that marshaling seems to be the way to go. So my question is basicly: how?
I think i need to create or somehow obtain a proxy object for the interface and use that to marshal calls to the original IDropTarget. I used the OLE/COM Object Viewer (that comes with Visual Studio) to look at IDropTarget and checked out its "ProxyStubClsid32" which seems to be "PSFactoryBuffer", so i looked up the IPSFactoryBuffer interface. Now at this point what confused me is that under IDropTarget it says that the ClassID of the factory is "0x00000320, 0x0000, 0x0000, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46" while IPSFactoryBuffer seems to have "0xD5F569D0, 0x593B, 0x101A, 0xB5, 0x69, 0x08, 0x00, 0x2B, 0x2D, 0xBF, 0x7A", aren't these ClassIDs refering to the same thing?
Anyways, what i am guessing now is that i need to create/obtain an IPSFactoryBuffer, use its CreateProxy to create a proxy interface, connect that somehow to the IDropTarget sitting in the other process and issue calls to the proxy. But if i try to create an IPSFactoryBuffer with CoCreateInstance i get the error "Class not registered", i also tried to use CoGetClassObject with the same result. And even if i had a factory, how do i create a proxy object connected to the original IDropTarget? About the original droptarget i have the following information: it's address and the handle of a marshaling window which is -most likely- created by the RegisterDragDrop call.
Am i completely off the right path? COM is sometimes a bit confusing to me. Thanks in advance for any hints or kicks which could get me ahead.
|
|
|
|
|
Hi there,
I have a strange error message that I would like to submit to you hoping you can help.
I have an MFC C++ application which communicates with a second MFC application through OLE Automation. This second application has a loop which constantly communicates with a hardware device through the serial port of the computer and updates some of its member variables reflecting the state of the hardware. The main application has a timer that periodically checks the values of the variables of the second application through OLE Automation.
My problem is that every now and then, apparently in a random fashion, I get the following error message "Overlapped I/O operation is in progress". If I close this message, it comes back up again almost immediately.
This is a rather generic message but I suspect it has something to do with my OLE communication. Does anyone have an idea? When that error occurs, the second application is still running fine and communicating fine with the hardware so I guess the serial communication is not the origin of the problem.
Could it be an issue linked to the lifetime of the handle on the OLE object?
In case that helps, here is how I start the second application from within the first one through OLE:
int CRXGemApp::StartRemoteApplication(void)
{
if(m_RemoteApp != NULL)
return 0;
if(m_RemoteApp == NULL)
{
m_RemoteApp = new CRXMFX();
COleException e;
if(!m_RemoteApp->CreateDispatch("REMOTEAPP.Application", &e))
{
AddToErrorLog("could not startthe Application");
delete m_RemoteApp;
m_RemoteApp = NULL;
return -1;
}
DISPID dispID;
BYTE *parmStr;
CString cx = "visible";
BSTR szMember = cx.AllocSysString();
m_RemoteApp->m_lpDispatch->GetIDsOfNames( IID_NULL, &szMember, 1, LOCALE_USER_DEFAULT, &dispID );
::SysFreeString(szMember);
parmStr = (BYTE *)( VTS_VARIANT );
}
int Timeout = 5;
int IncTime = 1000;
CChrono Chrono;
Chrono.InitChrono();
Chrono.StartChrono();
double t = 0.0f;
while(m_RemoteApp->GetStatus() < 0 && t < Timeout)
{
Chrono.DureeChrono(t);
}
if (m_RemoteApp->GetStatus() < 0)
{
StopRemoteApplication();
AddToErrorLog("Communication error with the hardware.");
return -2;
}
return 1;
}
|
|
|
|
|
|
Shucks, this is a bit difficult to explain, but hopefully someone will understand.
I am developing an application that reads data from a serial port. The device that connects to the port is not available yet - fortunately I know the data stream format. I want to develop the application using a "virtual" COM port, meaning I'll have another application producing a data stream to the COM port in use by the application in development.
To perhaps explain it better, I want to develop two apps, one that produces a data stream to "COM1" and the real application to read from this COM1 port. After testing with various values from the "COM" port, I want to distribute this app without further development and must be able to read from a real COM port.
Please point me in the right direction.
Thanks
the confused are confused beyond confusion
|
|
|
|
|
A little off topic to begin with, but this board is designated to contain questions about COM where the abbreviation stands for the "Component Object Model" and not the serial communications port.
Just in case you had them mixed up.
Now to a suggestion for your question:
Develop a simulator for your device, but instead of a serial port you can use named pipes. Create the named pipe in your simulator with ::CreateNamedPipe() and then open it with ::CreateFile() in your application that is supposed to communicate with your future device.
You will be able to use the same API as when using a real serial port, but calls to ::SetCommState() and such will return FALSE . You will, however, be able to build the complete communication logic and the protocol and leave it unchanged when you open the real serial port instead of a named pipe.
I've used this technique several times in situations very similar to yours, which made it possible for me to develop client applications without the hardware.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Hi,
i had creted Outlook addin in VS-2008, its working fine in my machine but when i try to install it in client machine, its giving the following error
Location: C\Program Files\Common Files\Microsoft shared\VSTO\8.0
Load Behaviour: Not Loaded. A runtime error occured during the loading of the COM Add-in
what are the Prerequisites reqitred for creating Outlook Setup.
Can any one please help me for installing in the client machine.
regards,
valli
srivalli.krothapalli
|
|
|
|
|
A DLL dependency issue maybe? You might want to verify that all the dependent DLLs that your add-in requires are present on the client's machine.
--
gleat
http://blogorama.nerdworks.in[ ^]
-- Number Two's eyes narrowed and became what are known in the Shouting and Killing People trade as cold slits, the idea presumably being to give your opponent the impression that you have lost your glasses or are having difficulty keeping awake. Why this is frightening is an, as yet, unresolved problem. -- HHGTG
|
|
|
|
|
Is the client machine running Windows 98/ME ?
|
|
|
|
|
Im working on a small project, mainly just a "can i do it".
I have a project in VB6, and i want to write a C++ ocx with managed code to call some C# functions, so basicly kind of like a wrapper.
While im sure i can pass data from vb6 to C#, i want to know how i can call functions in a VB6 class from c#
i was thinking that i might need to do something like this:
Pass Object from VB6 to c++ ocx file.
In C++, look at functions and make a list and send that to c#
When c# wants to run a function, it says to C++ to run X function.
C++ then runs that function in the class file.
Note that i havn't done anything remotly like this, and i don't even know exactly what exactly to ask for. Any tips would be nice
|
|
|
|
|
Matthew Cash wrote: I have a project in VB6, and i want to write a C++ ocx with managed code to call some C# functions, so basicly kind of like a wrapper.
Let me get this straight - you want to create a native OCX using managed C++ so you can call C# functions from a VB6 project? Whoa! That's kind of taking interop to the extreme isn't it?! Just kidding!
Seriously though, why are you proposing to have a C++ middle-man to liason between the VB6 component and the C# code? Can you not just create an ActiveX DLL using VB6 and use interop to invoke it from C#? And for invoking the C# code from VB6, use "TLBEXP" and "REGASM" to export the .NET class as a COM component.
Shouldn't you just be able to use .NET interop as the middle-man brokering calls?
--
gleat
http://blogorama.nerdworks.in[ ^]
-- Number Two's eyes narrowed and became what are known in the Shouting and Killing People trade as cold slits, the idea presumably being to give your opponent the impression that you have lost your glasses or are having difficulty keeping awake. Why this is frightening is an, as yet, unresolved problem. -- HHGTG
|
|
|
|
|
I did try something like that once, but for some reason, it never liked to work right.
all of the examples ive seen with .net COM stuff were for web pages, and didn't work well, or at all, for VB6
like i said, i don't really know what im doing, i was hopeing someone could guide me.
|
|
|
|
|
For an application running on two separate machines I use DCOM to communicate. On system 1 a CoClass exists, hosted in a COM server which acts as a singleton (using DECLARE_CLASSFACTORY_SINGLETON ATL). This CoClass is created from system 2 through DCOM, but also local by system 1.
Despite using the singleton classfactory still two instances of the CoClass exist in running server (one for all local system 1 clients, and one for all dcom clients). I've tried changing a number of security settings through DCOMCnfg but this didn't help (sometimes even ended up with two servers next to each other ).
Strange thing is that when the CoClass is first created through DCOM and later by the local user it all seems to work. The other way around however always creates two instances. Unfortunately both systems can be switched on or off seperately so the starting order isn't defined.
Current settings are:
Authentication Level - Connect
Impersonation Level - Identify
Identity - This user (same user as the local on system 1 also CoCreating the CoClass)
Both systems are using Windows XP SP2.
Anyone got any idea on why this doesn't work ( and hopefully knows how to solve ) ??
modified on Thursday, October 30, 2008 6:25 PM
|
|
|
|
|
Hello:
I'm not sure if this is the right posting area for this? I'm new to this sight and really green when it comes to command line. I'm a student and need help with a few questions. I have answered them but have questions on the last three. Forgive me if this is not the area to ask this.
I'm being asked to write five lines that would perform the following in a batch file.
1.Document the batch file explain that it is a demonstration file.
Rem Demonstration File
2. List the files in the A:\temp directory
dir A:\temp
3. Display the contents of a file in the a:\temp directory that is specfied when the batch file is called.
( This is were i have some questions)
Type %1 (is this correct?)
4. Rename the above file to name.new
without the ren is there another way of doing this?
5. Display the contents of the Name.New file.
Type Name.New (is this correct?)
Any help would be greatly appreciated !
|
|
|
|
|
Hi, all!
Help me please with ISpoolerHook. How to use it? Needs some examples... Thnks
|
|
|
|
|
Hi,
I have created a fully editable data using template columns for using it for data entry and editing.Can some one help to validate the data entered into the grid and also check for duplicates. I am reading all the data from the datagrid into a typed dataset for saving into database so essentially I need to check for duplicates in the dataset. My datagrid contains 2 columns and each column is a textbox to enter data.
Uday.
-UdayKiran
|
|
|
|
|
when i move a ocx control form my PC to a new computer, use "regsvr32 file.ocx", it show a error message of "loadlibrary("file.OCX")failure", but in my PC, it was working good not any failures.
can anyone help me to resolve this problem?
Thanks for you help.
|
|
|
|
|
Use Depends on the .ocx file to make sure that all of the dependencies are present on the target computer.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
|
|
|
|
|
It seems all dependencies is right, look as follows:
ADVAPI32.DLL
COMCTL32.DLL
GDI32.DLL
GISQCONTROL.DLL
GISQSTYLEDIALOG.DLL
KERNEL32.DLL
MFC42D.DLL
MFCO42D.DLL
MSIMG32.DLL
MSVCRT.DLL
MSVCRTD.DLL
NTDLL.DLL
OLE32.DLL
OLEAUT32.DLL
RPCRT4.DLL
SECUR32.DLL
USER32.DLL
GISQCONTROL.DLL and GISQSTYLEDIALOG.DLL, it my compiled com dll. is there any another issues in this case.
|
|
|
|
|
Try profiling it through "dependency walker". Open "regsvr32.exe" in depends and select "Start Profiling..." from the "Profile" menu. Pass the path to the OCX in the "Program arguments" box and click "OK". See what DW reports in the messages box. You should get a clue or two.
--
gleat
http://blogorama.nerdworks.in[ ^]
-- Number Two's eyes narrowed and became what are known in the Shouting and Killing People trade as cold slits, the idea presumably being to give your opponent the impression that you have lost your glasses or are having difficulty keeping awake. Why this is frightening is an, as yet, unresolved problem. -- HHGTG
|
|
|
|
|
Hi,
Can anybody please give me some free links to learn the topics VB6, ASP and COM. I dont have much idea of it as I am .Net programmer but I want to learn them.
Thanks,
Aleem Mohammad.
Thanks & Regards,
Md. Abdul Aleem
NIIT technologies
|
|
|
|
|
I am getting this error while accessing the lotus notes. It is working fine when executes in my system but giving this error while executing in IIS virtual directory.
The error is
Retrieving the COM class factory for component with CLSID {29131539-2EED-1069-BF5D-00DD011186B7} failed due to the following error: 8007000e.
Source Error:
Line 22: protected void btnAddress_Click(object sender, EventArgs e)
Line 23: {
Line 24: Domino.NotesSessionClass sessclass = new Domino.NotesSessionClass();
Line 25: sessclass.Initialize("lotuspwd");//PWD is required
Line 26: Domino.NotesDatabase notesDB = sessclass.GetDatabase("serveraddress", "names.nsf", false);
Thanks for any help.......
Lakshmi
|
|
|
|
|
HRESULT 8007000e corresponds to E_OUTOFMEMORY.
For Notes/Domino specific queries Lotus Notes forum[^] might be a good place to ask.
Sohail
modified 21-Apr-21 21:01pm.
|
|
|
|
|