|
i am getting this error after adding "mfc as shared dll", and inluding afxsock.h
#error WINDOWS.H already included. MFC apps must not #include <windows.h>
Thanx in Advance
Z.A
|
|
|
|
|
Hello, for a few weeks now I have been trying to get my directX-application work in internet explorer. The problem is, i don't know what lines of code i need or how to make a user control or activeX control work in internet explorer. My application scrolls text over the screen using DirectDraw. In a form as a stand-alone application, it works fine. But when I try to use the code in a ActiveX Control it shows sh*t!
Can anybody help me? I'm really desperate!
|
|
|
|
|
Hi,
i am working on Project(i.e distributed application) involves ATL COM component and MFC GUI application. The arcitecture of of the project is as follows
--> The ATL-COM component project (named as PAObjects) generates PAObjects.dll. This project is having few function written to querey the
database in MS SQL server 2000. These functions are exposed through COM interface.
--> I wrote MFC GUI application that make use of function written in above ATL-COM component project.
--> The above two project modules are running on windows 2000 server operating system.
Actually, I want to debug the functions written in ATL-COM component project (named as PAobjects). The following steps i followed to debug the
ATL-COM component.
1) In COM DLL project, i set the break point at the required location within function. Also in visual studio IDE project--> setting option, Under Debug Tab, for "executable for debug session" , i provide path to my MFC application EXE.
2) Also set Debug break point in MFC application, from where call is made to ATL-COM project function.
3) i compiled both the modules in Debug mode. Also registered the COM dll.
So when i am trying to debug the function in ATL-COM project, Control is not at all comming to function in ATL-COM project.
Can anybody suggest me, what else setting is required to debug this function.....Any Artical or E-book or Link focusing on this debugging issue will helpful to me..
thanks
Nimesh Patel.
Nimesh
|
|
|
|
|
Which project are you debugging? If you debug the MFC exe, then any breakpoints (using software, like Pressing F9) will not break execution in the DLL.
1- Either you can run the exe using the DLL project , and put breakpoints where needed in the DLL code.
2- Or, put a breakpoint on the function call in the exe like this:
pDll->SomeFunc();//---Breakpoint here---
Then step-into (F11) to enter the function in the dll code.
this is this.
|
|
|
|
|
Yes i am using first option ,
1) Either you can run the exe using the DLL project, and put breakpoints where needed in the DLL code.
i was following the same step but still it is not landing up into COM dll project breakpoints at all.
thanks
Nimesh
Nimesh
|
|
|
|
|
One more thing you can do: Put hard-coded breakpoints in the DLL code and compile and debug it:
__asm int 0x03;
And are you using a DCOM service? That would require a different methodology.
this is this.
|
|
|
|
|
And are you using a DCOM service? That would require a different methodology.
Yes I am using DCOM service... I like to know the Methodology which is requried for this. If u know good web-link exploring this topic or E-book or article ... Let me know ... which help me clearing my understanding .....
thanks
Nimesh
Nimesh
|
|
|
|
|
|
Hi all,
iam working on WMI(windows MAnagement Instrumentation). i have created a sample application using WIn32_process class . iam able to display messages when an Process is opened or closed.
now what i want to do is to create an object and then register a call back function . This class also take process names through another method . this class should call the above callbackfunction when one of the process(taken through the above method) is either started or exited.
can you please suggest me how to procedd with this task.
Thanks in advance
abhi
|
|
|
|
|
Hi all
i have a task on Server/client communication using DCOM.
genrally we communicate to server from client(we call component interface methods from client by getting the interface pointer).
But i want to communicate from server to client. i want to send messages from server to client.
Can you please suggest me how to proceed with this,
thanks
abhi
|
|
|
|
|
hi
i want to do some operation on opened file.
that means the file is already opened by
other process in exclusively mode.At the same time
i want to do some operation on that file like copy,open..
in my program.
is it possible in COM?
can anyone help me please?
nirmal
|
|
|
|
|
This issue is not releated to COM.
Steve
|
|
|
|
|
is there a pre-existing implementation of IStream (or ISequentialStream) that wraps around pipes or sockets or something? I want to send lots of data between two COM objects in different apartments & need something efficient
--Jason
|
|
|
|
|
The normal way to solve such a problem is simply to marshal a pointer to the receiving COM object to the senders apartment and then the sender can simply call a method on the receiver (really the receiver’s proxy) and push the data at it - There is no need for pipes and the like.
Steve
|
|
|
|
|
Sure, that's fine if you have a finite amount of data transfered synchronously from object 1 to object 2.
But what if object 1 is pumping out an infinite (or at least, indefinitely large) stream of data, say in 100 byte chunks, one chunk every 100usec, and I want object 2 to be able to process the stream of data at a slower rate (e.g. 1000 chunks every 100msec, or whenever object 2 gets a chance)?
(think of MP3 or video streaming, though in my case the application is completely different)
--Jason
|
|
|
|
|
In that case the receiver could simply queue the data and not process it immediately. The sender could call CoTaskMemAlloc to get some memory and fill it, then call the method on the receiver’s proxy and give it the memory block. The receiver would stash the address of this memory block in a queue. When the receiver gets around to it would process it and free the block by calling CoTaskMemFree .
Steve
|
|
|
|
|
right, but then I have to take an RPC call every time the sender wants to send something. This is awful expensive. And at a source rate of 1 chunk every 100usec, it essentially won't work unless the two objects live in the same apartment. Some informal experiments seem to indicate inter-apartment calls on my CPU take between 100us and 1msec depending on how much data is marshalled. Actually in a lot of cases my chunk size might be 10 or 20 bytes every 100usec, so there's a tremendous amount of overhead here for the data rate.
I've thought of having the sender batch it up into larger chunks arriving slower & doing essentially what you're talking about, having the receiver queue things explicitly (which is what I'm doing now to get around the problem), but that's a bit kludgy. The major downsides in my application are that [a] my object's clients have to know about & manage the batch-processing (not that bad, but nevertheless a pain) and [b] if the sender dies before it finishes a batch, I lose the chunks that the sender had queued up in the partially-stored batch. This is a datalogging application & I need to lose as little data as possible. (especially if the last bits of data would tell me something about the cause of the sender's death; the sender program may be getting this data from an unreliable program which could cause it to crash. yes I know programs shouldn't crash but sometimes they do, especially if they're not mine )
If I were to use a pipe (and I'm implementing both objects so they could, theoretically use out-of-band methods to talk to each other, though I'd rather not), the CPU overhead seems like it would go way down (admittedly, haven't tried it yet), and everything that the sender sticks into the pipe before it dies should eventually arrive at the receiver (even if the receiver takes a bit of time to get around to reading from the pipe).
Summary: I care about throughput, not latency, and the # of method calls through standard COM eats into my throughput too much, so I was hoping there would be a pipe for me to stuff bytes into. These are really bytes, they're not interface pointers or BSTR's or anything. (Or if they do mean something, they're handled at my application level.)
--Jason
|
|
|
|
|
In the scheme I described earlier using CoTaskMemAlloc you only send the address of the memory block and perhaps its size - Not 20 bytes. That said, if you want to use pipes the only real problem is getting the handles to the pipes to the sender and receiver. You could use CreapeNamesPipe and transmit the name of the pipe.
Steve
|
|
|
|
|
If you are interested in getting the highest performance, I would think that a memory mapped file like this would produce the highest performance:
http://www.codeproject.com/threads/XQueue.asp[^]
Using the GridView is like trying to explain to someone else how to move a third person's hands in order to tie your shoelaces for you.
-Chris Maunder
|
|
|
|
|
Hi,
I'm trying to create a multiple instance of the same ActiveX(OCX)objects from a container application(Dialog). The problem is that the multiple instance of each object share the same process. Is there a way to create the objects per process?
Thanks
|
|
|
|
|
Anthony9887 wrote: The problem is that the multiple instance of each object share the same process.
Of course, that's part of the whole idea with an ActiveX control since an ActiveX control is in fact a DLL encapsulating with one or more COM objects with automation interfaces and usually a GUI.
Anthony9887 wrote: Is there a way to create the objects per process?
Why? It doesn't make sense.
It would be like being forced to start Word to be able to perform a spell check in Outlook.
What are you trying to do and how can the above be a problem?
--
Roger
It's supposed to be hard, otherwise anybody could do it!
|
|
|
|
|
Hi Roger,
I have a custom server(OCX) which samples data from a D/A hardware through a container application. I want to be able to have 1 container application, that have many server objects sampling data from multiple hardware. When I create the first instance of the server object, it connects and samples, when I create the instance of the second server object, it connects, but the previous object is no longer sampling. When I call a method from the first server object to start sampling, the second object begins sampling. I'm a little confused? Any ideas?
Regards,
|
|
|
|
|
I don't know what kind of hardware you're using or how your server is implemented.
However, I suspect the server to some kind of functionality to be able to select which hardware to use where you provide an index or some string to identify the hardware, e.g. "COM1". Otherwise you would not be able to use multiple hardware, which may actually be the fact, in theory, if the server is badly designed.
Regarding the fact that your first instance of the server stops sampling when you create a second server could mean a lot of things. One could be that both servers are using the same hardware because both servers use some kind of default hardware index or similar.
Without more information about your server's interface at least, it's not possible to help you further. Besides from guessing about how it should work...
Code snippets of how you create your server and what hardware you're using would be nice, as well.
--
Roger
It's supposed to be hard, otherwise anybody could do it!
|
|
|
|
|
Hi Roger,
I think I found the problem. I have global pointer to the Server Object class and this global pointer points to this object during creation. Whenever I create a new instance of the Server object, the global pointer is re-assigned and pointed to the new object. How can I avoid this? Is there a way not to make the pointer global. I do need access to the Server Object via this pointer.
Thanks
|
|
|
|
|
Is creating an Office COM addin using ATL with Late Binding possible? Most of the examples in CodeProject use Early Binding. Using #import to import the libraries means that Early Binding is used, isn't it?
Well, I want to create an ATL Office Addin but with Late Binding. Is this possible? If possible, could anyone guide me.
Thanks.
---
With best regards,
A Manchester United Fan
The Genius of a true fool is that he can mess up a foolproof plan!
|
|
|
|