|
To send a message use
// see help of PostMessage for parameter options
#define WM_GENNIE_LEARN_MODE 2000 // use any id as you desire
PostMessage(WM_GENNIE_LEARN_MODE);
Now in the message map of the class where you want the message to be captured (namely the parent class in your case) make an entry in the BEGIN_MESSAGE_MAP section as given below
IMPLEMENT_DYNCREATE(..., ...)
BEGIN_MESSAGE_MAP(... , ...)
//{{AFX_MSG_MAP(CDict1View)
ON_MESSAGE(WM_GENNIE_LEARN_MODE,OnGennieLearnMode)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
Now declare the handler function, as given below
//{{AFX_MSG(CDict1View)
afx_msg LRESULT OnGennieLearnMode(WPARAM wParam, LPARAM lParam);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
and define it as
LRESULT YourParentClassName::OnGennieLearnMode(WPARAM wParam, LPARAM lParam)
{
// blah blah blah ...
return ...;
}
/**********************/
The above code will send a message WM_GENNIE_LEARN_MODE to the parent window where it would be handled by the function OnGennieLearnMode(). In your case you would sen the DBLCLICK message, and handle it in your own handler function.
hope it helps,
-cheers
-kashif manzoor
peace to all
|
|
|
|
|
|
Hi All,
I wonder if any of you guys can help - and I certainly need some now!! For our software, I have written a grid control that looks like the MS Outlook grid control. However, in this release of the software I have been asked to add Outlook style grouping. I am finding the task harder than I thought and am now very worried about the looming deadline.
Does anyone know of any code for grouping data (each row in the grid is a safearray of variants). Given certain grouping criteria (i.e. group by column 2, then by 3), I need to get the data into a suitable datatype and then render it on the screen. Once data is in the datatype, I need to be able to iterate through it. I would be very, very grateful if anyone could point me to any example code of doing this or something similar to this.
Thanks,
Mike.
|
|
|
|
|
Check ATL part in CP,there are some example about grid,safearray and ...
Click here
Mazy
Don't Marry a Person You Can Live With...
Marry Someone You Can Not Live Without
|
|
|
|
|
I am having a problem with the File menu's Open command. When I run my application and select Open from the File menu after performing some other action within the application or if I select Open from the File menu immediately upon entering the application, the Open file dialog opens fine. On the other hand, if I select Open from the File menu, click the "Cancel" button in the dialog, and then select Open again from the File menu, the application shuts down in debug mode and it inserts junk data into the "File Name" textbox in Release mode.
I'm not sure what I'm doing wrong since I haven't modified any of the code that the Application Wizard creates for you when you set up a new project. I'm not sure how the junk data is getting into the application or why. Does anyone have any thoughts?
|
|
|
|
|
If you are sure you havent touched the app-wizard generated code and yet this happens, then its time to either reinstall VC++ or probably your OS itself.
Nish
Nish was here, now Nish has gone;
He left his soul, to turn you on;
Those who knew Nish, knew him well;
Those who didn't, can go to hell.
I like to on the Code Project
Sonork ID 100.9786 voidmain
www.busterboy.org
|
|
|
|
|
I'm running it on a brand new computer that I got 3 weeks ago and I installed VC++ then. Unfortunately, I don't think it has anything to do with the OS or the installation of VC++.
|
|
|
|
|
Hi,
I need to run Ms Word automated, and my idea is to add some buttons to insert the Word Doc. some controls that has some reports thing, ... I will need to insert them ( maybe just a metafile, with some little info to know some settings).
Then I would need to insert the activeX in the word doc, and set the data ( metafile, and some properties).
And I would need to iterate through the activeX controls ( or detect the focus of the ActiveX file), and retrieve some properties from it ( take it from the word instance to my current program).
Is that possible ? ( the main problem that I see, is that the ActiveX DLL is running in a different proccess than the Main Application) Thanks, Bye !
Braulio
|
|
|
|
|
Hi guys,
This is my first post in code project. I am new to Win32 Application development. I have written the following code to check for CDROM drive on computer. THe code seems alright but when I compile it, I get the following error
error C2065: 'sprintf' : undeclared identifier
I have included stdio.h but still I cannot resolve the problem. Hope someone helps me. thanks
#include <windows.h>
#include <tchar.h>
#include <stdio.h>
#include "stdafx.h"
int test;
UINT retval;
LPCTSTR chTest;
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
char ascii;
char ascTemp[80];
ascii = 'A';
while (ascii <= 'Z') {
test = sprintf(ascTemp,"%c:\\",ascii);
if (GetDriveType(ascTemp)== 1)
{
test = MessageBoxEx(NULL,"Found","ABC",NULL, NULL);
}
ascii = ascii + 1;
}
return 0;
}
|
|
|
|
|
tppradeep18 wrote:
I have included stidio.h but still I cannot resolve the problem. Hope someone helps me. thanks
Did you mean to type stdio.h ? I can't tell because you've not shown the headers, you need to check the box that says not to use HTML, your includes have been stripped because they look like tags. If you have included stdio.h, then I dunno why it's not working.
In this case sprintf is obviously OK, but overall I prefer to use ostringstream for safety.
ascii += 1 is preferred as a matter of efficiency, you save the creation of a tempory.
It's a good idea to specify global scope with the :: operator, like this ::MessageBox(etc
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Picture the daffodil. And while you do that, I'll be over here going through your stuff.
|
|
|
|
|
thanks graus for that instant reply.
I have editied my question. I liked the tips given by you for increasing the efficiency. I am still caught up with the error. Any more clues as to why this is happening.
|
|
|
|
|
include "stdafx.h" before including anything else i.e. move #include "stdafx.h" statement to the top and you won't get the error message
-cheers
-kashif manzoor
peace to all
|
|
|
|
|
thanks kashif. It worked. My problem is solved. thanks a lot !!!
|
|
|
|
|
#include < windows.h >
#include < tchar.h >
#include < stdio.h >
<font color=green>#define SIZE 80</font>
int test;
UINT retval;
LPCTSTR chTest;
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
char ascii;
char ascTemp[SIZE];
ascii = 'A';
while (ascii <= 'Z') {
<font color=green>test = _snprintf(ascTemp,SIZE,"%c:\\",ascii); </font>
if (GetDriveType(ascTemp)== DRIVE_CDROM)
{
<font color=green>_snprintf(ascTemp,SIZE,"Found CDROM %c:\\",ascii);</font>
test = MessageBoxEx(NULL, ascTemp, "CDROM Drive", MB_OK, 0);
}
++ascii;
}
return 0;
}
It works..try it. Use _snprintf instead of sprintf for bounds safety.
Atul
Sonork ID : 100.13714 netdiva
|
|
|
|
|
Hi. I am having a tough time finding a way to tell if a printer is actually connected to a computer. By knowing this, I can save it to disk instead of printing it etc. Does anyone know a good way to find out if a printer is actually connected?
|
|
|
|
|
MSDN:
The EnumPrinters function enumerates available printers, print servers, domains, or print providers.
Sometimes I think the surest sign for intelligent life elsewhere in
the universe is that none of them ever tried to contact us.
|
|
|
|
|
Hello
I want to know if is possible to write a NT service, in a DLL (I know that some system services reside in dll's, but I don't know how could I implement myself).
What is a skeleron of such program???
Thank in advance
|
|
|
|
|
I think NT services are not in DLL,They are as EXE,but to become sure there thre are some article in CP by Brian Hart,you can check them or put message there,then Brian will answer you.
Mazy
Don't Marry a Person You Can Live With...
Marry Someone You Can Not Live Without
|
|
|
|
|
Miguel:
I love to write NT services, I write two or tree NT services by month...
I need to say you taht Is not possible, to write a service like a dll, the service is an .exe file because the NT service manager call to the applications that are informed in HKEY_Local_Machine\System\CurrentControlSet\Services\<your service="">\ImagePath\<exe file="" name="">...
Check this and you will can see that all services in your machine are exes...
Regards...
If your computer says, "Printer out of Paper," this problem cannot be resolved by continuously clicking the "OK" button.
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
Thanks Carlos,
I think you are clear enough.
But don't bother if I ask you again,
in another form: is no chance to have the
Service Processing function (the function
which respond to SCM and other messages)
located in a DLL?
|
|
|
|
|
Don't problem with that.
You must to have the service in a exe file, but you can make dlls to manage messages, connctions with databases, etc. You only need the main loop in a exe with the basic functions of the service, like onservicestart, onservicestop, etc. You always need to have the control of your service in a exe file, if you are using dll for make other things, is not a problem, you only need to have care with some points....;)
Regards
My software never has bugs. It just develops random features.
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
Carlos Antollini wrote:
You must to have the service in a exe file, but you can make dlls to manage messages, connctions with databases, etc.
Thanks a lot for your quick answer.
Was very useful for me, because make me clear
enough what I have to do.
Regards,
Miguel
|
|
|
|
|
Could anybody helps me how to call Excel math functions from VC++ ??
Especially functions with direct parameters / not parmeters from the cells /
as a
ACCRINT
POWER
etc.
Mira
|
|
|
|
|
Do you want to interact with Excel for some reason, or do you just want the functions in math.h ?
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Picture the daffodil. And while you do that, I'll be over here going through your stuff.
|
|
|
|
|
I've got the following problem, andwould be pleased to have any info or tip to solve it:
I use for my OpenGL scene texture objects which I load in the texture memory (on a Nvidia GeForce2 GTS). I'll check they are resident using glAreTexturesResident, everything is fine. The problem is when I delete these textures objects (using glDeleteTextures), and re-create others, those can't no more be loaded as resident, as if the previously ones were not freed from the texture memory, and still use the space. The consequence is the frame rate abruptly falls, logically.
If anybody has info, please help ! TIA.
K.
|
|
|
|
|