|
Isn't IDD_ControlBox a macro for an integer identifier? Try with
DialogBox(hInstance, MAKEINTRESOURCE(IDD_ControlBox), hwnd, (DLGPROC)MyDlgProc);
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Thanks! Dialog box comes up even though there are still a few things to be fixed. But thanks a lot!
|
|
|
|
|
I can't find any CListCtrl member functions to do this.
Thanks!
|
|
|
|
|
How about SetColumnWidth() ?
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Hi!
I want to create a dialog which resize to only caption when user double-click the caption area, then expand back when user double-click the caption again.
How can we detect that mouse event in the dialog WindowProc? left-click, right-click, double-click?
I tried WM_LBUTTONDOWN, WM_LBUTTONUP, WM_LBUTTONDBLCLK, but it works only in dialog client area.
Thank you,
Sovann.
Everything should be made as simple as possible, but not simpler [Albert Einstein]
|
|
|
|
|
try this,
WM_NCLBUTTONDBLCLK
The WM_NCLBUTTONDBLCLK message is posted when the user double-clicks the left mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.
Arjan.
|
|
|
|
|
Hi,
I am using an ActiveX in CFormView
The ActiveX keeps on updating its contents and the Parent(CFormView) is not
aware of it, due to which the Parent displays the old contents.
How do I inform the CFormView to update the change so that there is no flicker
while updating the ActiveX . I get lots of flicker with InvalidateRect.
Thanks,
Sansky
John 3:16
For God so loved the world,
that he gave his only begotten Son ( Jesus Christ ) ,
that whosoever believeth in him should not perish, but have everlasting life.
|
|
|
|
|
Hi Sansky!
Your activex control needs to notify its container. Normally in ATL, just call FireViewChange .
ÿFor the bread of God is he who comes down from heaven and gives life to the world. - John 6:33
|
|
|
|
|
I am a newbie to multithread, I have no idea of creating a thread pool, Could you help me? it is better if you give some sample code.
Thank in advance!
|
|
|
|
|
|
Is there anybody here who knows how a cd emulator program (such as virtual cd, deamon tools etc.)works in Win NT systems (2k/xp)? I think these emulators might works as REAL cd rom drivers,but not sure (if so, do we need to use window ddk and follow the wdm model to develop just an VIRTUAL cd ?). Or can you just suggest some articles talking about this issue? Thank you very much !!!
|
|
|
|
|
Well I know a way for making a virtual cd... (it might not be the best) You first copy the files from the cd into a directory in C: or D: (your harddrive)... Let's say 'C:\VIRTUALCD\'... and your new harddrive will be "J:".Then you create a program and:
<br />
system("subst J: 'C:\\VIRTUALCD");
system("subst x: /D");
Well this creates a virtual harddrive more than a virtual cd and I dont know if this will work as a virtual cd... but maybe this will show you a path... Just let me know if you find something better...
Well... I am a beginner ...
|
|
|
|
|
subst x: is supposed to be subst J:
Well... I am a beginner ...
|
|
|
|
|
I am a beginner too :p
thank you very much for your reply, really helpful~~
when I get some magnificent progress, i'll inform you ~~
|
|
|
|
|
Do you know how i can make a plugin for internet explorer or at least give me some resources or docs. I can't find any good reference for the internet explorer API. I think i need to learn some more about COM or ActiveX but I'm not sure what. I need to know how to make a plugin for IE so I can browse a remote filesystem through an ActiveSync connection.
thanx.
|
|
|
|
|
Look for Browser Helper Object (BHO).
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Membership in Thread is defined by object or by method ? -
If I call method of object from one thread,
will other object's methods be blocked from other thread,
in MFC ?
This is apartment threaded library ?
Thanks
|
|
|
|
|
Unless you're going through COM, there is no synchronisation between threads. If going through COM (i.e. one object is created using CoCreateInstance ), a proxy may be added by COM if the threading models don't match.
You should perform your own synchronisation wherever needed.
|
|
|
|
|
Hi All,
I am new to the VC++ development.
I am using the Word Object Library in Visual Basic,
Now I wanted to do the same in VC++.
I want to use it in console mode.
May you give me guidance to do the same.
Thanks.
GTS
|
|
|
|
|
Check out MSDN article Q178749.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Hi David,
You showed the perfect start place.
Thanks.
GTS
PS - 5 birds left, 3 of them only decided not fly away yet.
|
|
|
|
|
Hey all,
Im new to C++ and MFC and am trying to write a chat program for direct IP connections via TCP/IP.
For that I derived a class from CAsyncSocket, createt an Instance (m_ConnectSocket) and can now send CStrings via
m_ConnectSocket.Send(Data, Len) and receive them with
m_ConnectSocket.Receive(Buffer, BufferSize)
1.How can I now send and receive different variables...and distinguish them?
I just dont know how to use some kind of flag.
2.Also I would like to know how to get the Length of other objects...e.g. if i want to send a whole struct or Instance of another class.
Please help me
|
|
|
|
|
Something tells me that this is not just a "chat" program since you want to "send and receive variables".
What kind of a problem are you trying to build a solution for?
(Looks like asking: "I've bought a boat. How can I make it fly?" instead of asking "I want to go to the moon. How can I get there?" )
pillepop wrote:
1.How can I now send and receive different variables...and distinguish them?
I just dont know how to use some kind of flag.
2.Also I would like to know how to get the Length of other objects...e.g. if i want to send a whole struct or Instance of another class.
This looks like you want to transfer binary data (all kinds of variables) over a TCP/IP connection. Take a look at MSDN samples CHATSRVR and CHATTER. The messages sent could easily be altered to send binary data instead. The CMsg object sent over the TCP/IP connection contains a few variables. If you send similar objects looking like this:
class CMsg : public CObject
{
protected:
DECLARE_DYNCREATE(CMsg)
public:
CMsg();
virtual ~CMsg();
virtual void Serialize(CArchive& ar);
DWORD m_dwCommand;
DWORD m_dwLength;
BYTE* m_pBinaryData;
BOOL m_bClose;
}; you could send just about anything across the connection, including structures as long as the receiver knows how to interpret the data by reading the m_dwCommand value.
If this is not what you are after: forget the whole thing above!
If this is your problem I hope this helped or maybe you should have a look at DCOM where you create a component on a different machine and communicate with it through an interface via RPC (TCP/IP).
But that's a different ball game!
If you are interested in DCOM there are very useful articles here at CodeProject.
--
Rog
|
|
|
|
|
thanks for the answer
Hehe, good point.
Actually I started off building a chat-prog... and am now trying to enhance it a bit
First thing I meant was: I have 2 edit boxes whose contents are sent 2 the receiver, who then in turn has to show them again in different edit-boxes.
... doesnt this work with the normal send() and receive() function?
Well, and furthermore i want to transmit several integer ... as struct or whatever. That a bit more specific?
It might be a stupid question, but do I need .net for the MSDN samples? Unfortunately I cant open the .sln (got vc++)
|
|
|
|
|
Here's a good hint from writing software. Always do your best to seperate your UI from your back-end.
Your issues of how to display stuff is one thing, but what you actually intend to do here is: post a interpretable message from one client to another. Most chat programs do this by either using a specific packet/message format -- or use some "RPC".
Ignore the RPC for now.
What I think you need to do, is define a message format. This message format is something used by one client to convey one of many possible messages to another client.
The message that you want to send needs to be able to contain:
* identification of what type of message you are sending
* its good to include the size of the whole message
* and the "message" itself.
I should say, that my use of the word "message" should not be confused with a "chat message". This is a broader term for any bit of communication from one client to another.
In instant messaging, these messages are commonly:
* "instant message"
* "i want to log in and here's my password"
* "i am logging off"
* "here's a file"
* "i am away"
stuff like that.
You might consider XML as a nice and easily interpretable way to send messages.
But more often than not, the "message" is sent a data block.
Here's a possible message format -- this is a "message header";
[Message-Type: stored as a DWORD]
[Message-Length: stored as a DWORD]
With this information, you can now interpret the packet/message to determine what the caller wants to tell you. Message-Type of (3) might mean that you are "away". and a (6) might mean "i want to transfer a file".
Depending on the message ID, the data that follows will be in the format appropriate to that message type....
I'll leave you with this -- but I hope these clues help.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.santacruznetworks.com">Santa Cruz Networks</A>
|
|
|
|