|
AFAIK, MFC doesn't help there. You need to code using the following API functions:
GetFileVersionInfoSize
GetFileVersionInfo
VerQueryValue
First, you call GetFileVersionInfoSize to get the size of the version block. Next, allocate the memory and call GetFileVersionInfo. Finally, retrieve version # using VerQueryValue.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
OK, I know this sounds crazy (or at least it does to me), but I apparently when using the ListView control with multi selection turned on, you do not get WM_LBUTTONUP messages. (Q149275 and Q149326 in MSDN). Does anyone know of a better workaround than hassling with setting a window Hook to try and trap the message ? It definitely is there in - you can see it using Spy++.
What a stupid damn thing to have to track down ! Oh well -
Any help will be much appreciated
|
|
|
|
|
Does WM_LBUTTONUP show up in PreTranslateMessage? Just an idea
|
|
|
|
|
These KB articles describe problems with Visual Basic control, not the listview in general. And you see these messages in Spy++ - so what's the problem - your handler is not called?
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
Well first off I'm not using MFC though I did a test and the same thign happens.
I have sub classed the listview control, and in my WndProc the WM_LBUTTONUP does not get called except under odd circumstances as described in the KB articles. For example - I can click on another window, drag the mouse ovwer the list view, and then release, and then I get a WM_LBUTTONUP, but just a press and release of the mouse on the listview control does not send a WM_LBUTTONUP.
If I set the LVS_SINGLESEL style bit then I do get WM_LBUTTONUP as long as I dont click on any item. This is very weird ? This also happens in MFC. I don't know if this matters but I am using VC++ 6.0 professional with no service packs - maybe this is the problem
|
|
|
|
|
I'm afraid service packs are not a issue here. The problem exists deep inside comctl32.dll, where list control wndproc lives.
From the "Default List View Message Processing" in MSDN:
"WM_LBUTTONDOWN: Processed in different ways depending on whether a click or drag operation is being initiated. To determine which operation is involved, the list view control enters a modal message loop until either the button is released or the mouse is moved. [...] If dragging begins over the window background, the list view control enters another modal message loop, enabling the user to form a rectangle by dragging the mouse. Items within the rectangle are selected."
The keywords are "modal message loop" - listctrl wndproc uses its own GetMessage/TranslateMessage/DispatchMessage loop, which you can't override - seems that you'll need a hook.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
Hello everybody. I'm trying to create a fairly simple test application using MFC _without_ the AppWizard (I hate wizards). I'm trying to implement a static vertically split window with a different view in each pane. I have had no luck so far; I keep getting an assertion error within winocc.cpp when I try to run it (I've tried debugging, but don't understand a lot of the code in winocc.cpp).
Now my question is this: Could someone show me a simple app implementing a vertical splitter window with two different views (without using the AppWizard)? I don't need anything fancy, just a bare bones SDI app.
|
|
|
|
|
Why don't you create one with the wizard and then look through it. The *point* of the wizard is to save you the set up time that you seem to want to spend yourself, so it seems natural that you let it show you how it is done, then you can do it yourself.
To counter any hint of rudeness in the above, I admit to not using the ClassWizard terribly often because I like putting everything in myself.....
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
Hi-
-Pls post the code- if you want specific help -
Ok, you dont like the AppWizard, but I am sure you have the following..
1. A CFrameWnd derived class
2. A CView derived class ( for the left pane)
3. A CView derived class ( for the right pane)
I assume you also dont like ClassWizard, in that case
1. Manually override the OnCreateClient function in the CFrameWnd derived class.
2. Add a member variable CSplitterWnd (m_wndSplitter) in the CFrameWnd dervied class.
3. Add the following code to the OnCreateClient function..
.....
m_wndSplitter.CreateStatic(this, 2,1);
m_wndSplitter.CreateView(0,0,RUNTIME_CLASS(LeftView),CSize(rect.Width(),rect.Height()), pContext);
m_wndSplitter.CreateView(1,0,RUNTIME_CLASS(RightView),CSize(rect.Width(),rect.Height()/4), pContext);
.....
Voila thats it..
Also handle the WM_SIZE mthod if you want to..
One suggestion : If you refuse to use AppWizard or ClassWizard, you are setting yourself up for a lot of misery.
Later-
V
|
|
|
|
|
Thanks everyone. After a long and hard battle trying to do it myself without the wizard I have to admit to defeat. I cannot get it working without having debug assertions flying left and right. So I have seen the err in my ways and have switched to the dark side. After only about twenty minutes of getting familiar with the wizards I finally have my splitter window working.
|
|
|
|
|
What is my wrong in this code for dialing ???
VARIANT var;
CString szTemp("+++ATDP118\n");
var.vt = VT_BSTR;
var.bstrVal = szTemp.AllocSysString();
m_comm.SetPortOpen(TRUE);
m_comm.SetOutput(var); // WON'T WORK !!!
Please help me ...
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Are you sure this is the spot that won't work.
Are you at least able to send a single letter.
and could you elaborate on the "// WON'T WORK !!! " part please.
cheers
Alfadhly
It is Illogical to define an inventor by his invention
|
|
|
|
|
I'm using the following code which works (I've tested it until I dropped on the floor, so believe me):
m_pMSComm->SetRThreshold(1);
m_pMSComm->SetSThreshold(1);
m_pMSComm->SetInBufferCount(0);
m_pMSComm->SetOutBufferCount(0);
m_pMSComm->SetCommPort(m_iCommPort);
// Standard setings: 9600 baud, no parity, 8 data, and 1 stop bit. "9600,N,8,1"
m_pMSComm->SetSettings(m_sCommSettings);
// We want to read the buffer in it's whole
m_pMSComm->SetInputLen(0);
// Open the gates!
m_pMSComm->SetPortOpen(true);
// Call number 37 (for ISDN modems, use ATB20DT37)
CString sMessage = "ATDT37";
COleVariant vSend = sMessage;
m_pMSComm->SetOutput( vSend );
Hope this helps a little. Let me know where the problem lies.
Structured programming vs. chaotic mind boggling
|
|
|
|
|
I wrote it, but this code won't work, too.
My program can only open COM port, but my program can't dialing !!!
m_comm.SetRThreshold(1);
m_comm.SetSThreshold(1);
m_comm.SetInBufferCount(0);
m_comm.SetOutBufferCount(0);
m_comm.SetCommPort(3);
m_comm.SetSettings("9600,n,8,1");
m_comm.SetInputLen(0);
VARIANT var;
BSTR bstr_string = SysAllocString(L"ATDP118");
var.vt = VT_BSTR;
var.bstrVal = bstr_string;
m_comm.SetPortOpen(TRUE);
m_comm.SetOutput(var);
SysFreeString(bstr_string);
Please help me ... i need your help ...
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
2 tips:
1) I see you use ATDP instead of ATDT. I don't know what's the difference, but ik know ATDT works
2) What I forgot to mention was that instructions to the modem must be followed by a Carriage Return / Line Feed. So you should do this:
const LF = '\012';
const CR = '\015';
SysAllocString(L"ATDT118" + CString(CR) + CString(LF));
Hope this helps
Structured programming vs. chaotic mind boggling
|
|
|
|
|
Excellent, very good, nice work, good skill, ...
Yeah, i wrote "ATDP118\015\012", this code will work.
By the way, ATDT is for Tone dialing and ATDP is for Pulse dialing ...
Thanks alooooot again for your helps ...
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
I have other question about MSCOMM ...
What is DTREnable and RTSEnable ???
I read MSDN, but i din't understand.
Please explain about it ...
And please explain to me, i must put true in DTREnable ??? or not ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
As far as I understand it, it's got something to do with the events MSComm generates...
If you put DTREnable to true, you will get a DTREnable-event on the moment the DTR light on your modem goes on or off. The same is true for the RTSEnable thingy.
Best practice is to put both values on true. This can help you a lot if you implement the communication on an event-driven manner... If you're sure you're never going to use the event anyway, I think it's okay to put it to false..
Structured programming vs. chaotic mind boggling
|
|
|
|
|
hmmm,
You write *event* in your reply ...
What is thease events ???
Does it is: Recivieing and sending events ???
So, please explain about thease events ...
Thanks.
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
MSComm can fire a function (let's say an event handler) every time something happens, like when the input or output buffer is full...
You can catch these events by adding an event handler to the MSComm object on your dialog using the classwizard. It also fires events for state-changes in the modem like the DTR or RTS light going on or off...
I can't help you that much on events, though, because I wrote around these events. I never liked events that much because they only make things more difficult to understand....
Structured programming vs. chaotic mind boggling
|
|
|
|
|
hmmm,
I think best way is using of MsComm defualt ...
In MsComm defalts: DTREnable is true and RTSEnable is false ...
In last thank you again for all helps ...
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Hi again.
I wrote sending data section in my program ...
Now, i want to create getting data section, just i want to know for do it, i must use of GetInput() or SetInput() or ... ???
For example for sending, we used of SetOutput(), now for getting ???
I'm watting for your reply ...
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
I have written an ATL com dll that manipulates some data, but now I want to add a Dialoge to the Dll to display the data ect... I have gon through the wizard and inserted an ATL dialoge but I am not too sure what I have to do now. It does not have an interface or anything like that so how am I supposed to display the dialoge from the calling application. How do I add any of my com objects to the dialog class, its doen't seem to like it at the moment.
If anybody has any any demos that would be great
Cheers
AndyC
|
|
|
|
|
Could someone please tell me how I know when user clicks on a bitmap (object of CStatic) in a dialog? I have got as far as making a dialog with a picture on it and dialog class with bunch of mouse message functions like OnLButtonDown and OnMouseMove and so on. I've also turned on Notify option for the static and given it a unique ID. ...Now what do I do?
Thank you.
|
|
|
|
|
I would just use GetWindowRect on the static and check if I am inside the rect using PtInRect and the mouse pos ( in LButtonDown).
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|