Click here to Skip to main content
15,914,642 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to draw Dashed Ellipse in Embedded VC++ Pin
Arun AC26-Nov-04 20:39
Arun AC26-Nov-04 20:39 
GeneralLittle Doubt Using Send Message Pin
ThatsAlok26-Nov-04 20:38
ThatsAlok26-Nov-04 20:38 
GeneralRe: Little Doubt Using Send Message Pin
PJ Arends26-Nov-04 20:53
professionalPJ Arends26-Nov-04 20:53 
GeneralRe: Little Doubt Using Send Message Pin
ThatsAlok26-Nov-04 22:36
ThatsAlok26-Nov-04 22:36 
GeneralRe: Little Doubt Using Send Message Pin
PJ Arends26-Nov-04 23:00
professionalPJ Arends26-Nov-04 23:00 
GeneralRe: Little Doubt Using Send Message Pin
ThatsAlok26-Nov-04 23:03
ThatsAlok26-Nov-04 23:03 
GeneralRe: Little Doubt Using Send Message Pin
ThatsAlok26-Nov-04 23:37
ThatsAlok26-Nov-04 23:37 
GeneralRe: Little Doubt Using Send Message Pin
PJ Arends27-Nov-04 0:07
professionalPJ Arends27-Nov-04 0:07 
ThatsAlok wrote:
::SendMessage((HWND)this->m_lHandle,WM_USER+90,0,(LPARAM)*ji);

ThatsAlok wrote:
int * i=(int*)lParam;

You have to fix one of these two lines. In the SendMessage line you are passing 10 (*ji, the value that ji points to) as the lparam. Then in the recieving function you are casting the 10 to an int pointer. So basicly you are telling the program that the integer you want to work with is stored at memory address 10. This most likely gives you an access violation.

In the following code, you will notice that ji is already a pointer (int *ji), so when we send it via SendMessage we do not try to deference it ((LPARAM)*ji) which ends up passing the value 10, nor do we take the address of it ((LPARAM)&ji) which is actually passing a pointer to a pointer to an int (int **).
int *ji = new int;
*ji = 10;
::SendMessage((HWND)this->m_lHandle,WM_USER+90,(LPARAM)ji);
...
int *i = (int *)lParam
If you have trouble with pointers read those two excellent articles I pointed you to earlier.



"You're obviously a superstar." - Christian Graus about me - 12 Feb '03

"Obviously ???  You're definitely a superstar!!!" mYkel - 21 Jun '04

Within you lies the power for good - Use it!
GeneralRe: Little Doubt Using Send Message Pin
ThatsAlok27-Nov-04 0:34
ThatsAlok27-Nov-04 0:34 
Questioncustom DWebBrowserEvents2 Interface? Pin
tkarven26-Nov-04 16:20
tkarven26-Nov-04 16:20 
GeneralPlease help me CPP Pin
bluehai26-Nov-04 16:02
bluehai26-Nov-04 16:02 
GeneralRe: Please help me CPP Pin
Anonymous26-Nov-04 21:44
Anonymous26-Nov-04 21:44 
GeneralRe: Please help me CPP Pin
bluehai26-Nov-04 23:54
bluehai26-Nov-04 23:54 
QuestionHow come no one has ever posting code related to USB port Pin
paracha326-Nov-04 15:50
paracha326-Nov-04 15:50 
AnswerRe: How come no one has ever posting code related to USB port Pin
Gary R. Wheeler27-Nov-04 2:14
Gary R. Wheeler27-Nov-04 2:14 
GeneralCurrent User Pin
BaldwinMartin26-Nov-04 13:35
BaldwinMartin26-Nov-04 13:35 
GeneralRe: Current User Pin
ThatsAlok26-Nov-04 17:20
ThatsAlok26-Nov-04 17:20 
GeneralRe: Current User Pin
BaldwinMartin27-Nov-04 9:47
BaldwinMartin27-Nov-04 9:47 
GeneralRe: Current User Pin
ThatsAlok28-Nov-04 17:27
ThatsAlok28-Nov-04 17:27 
GeneralRe: Current User Pin
Gary R. Wheeler27-Nov-04 2:18
Gary R. Wheeler27-Nov-04 2:18 
GeneralRe: Current User Pin
david_gilmour27-Nov-04 2:35
david_gilmour27-Nov-04 2:35 
GeneralRe: Current User Pin
BaldwinMartin27-Nov-04 9:46
BaldwinMartin27-Nov-04 9:46 
GeneralRe: Current User Pin
BaldwinMartin27-Nov-04 9:44
BaldwinMartin27-Nov-04 9:44 
GeneralDesign Skin for Program Pin
BRIMID26-Nov-04 12:46
BRIMID26-Nov-04 12:46 
GeneralRe: Design Skin for Program Pin
John R. Shaw26-Nov-04 13:08
John R. Shaw26-Nov-04 13:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.