Click here to Skip to main content
15,897,718 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Initialize into TCHAR** Pin
Cedric Moonen20-Oct-09 4:10
Cedric Moonen20-Oct-09 4:10 
QuestionDebugging in CString Pin
jung-kreidler20-Oct-09 3:19
jung-kreidler20-Oct-09 3:19 
AnswerRe: Debugging in CString Pin
Naveen20-Oct-09 3:37
Naveen20-Oct-09 3:37 
GeneralRe: Debugging in CString Pin
jung-kreidler20-Oct-09 3:44
jung-kreidler20-Oct-09 3:44 
GeneralRe: Debugging in CString Pin
Naveen20-Oct-09 3:49
Naveen20-Oct-09 3:49 
GeneralRe: Debugging in CString Pin
jung-kreidler20-Oct-09 20:52
jung-kreidler20-Oct-09 20:52 
QuestionHow to save matched characters into variables in wildcard matching Pin
moh.hijjawi20-Oct-09 3:13
moh.hijjawi20-Oct-09 3:13 
QuestionNOTIFYICONDATA Datatype access violation when using memset or zeromemory Pin
Nicola Curran20-Oct-09 2:52
Nicola Curran20-Oct-09 2:52 
Hey, wondering if anyone knows what's going on here If i define my class as below when the memset() function runs there is an access violation. However if I define NOTIFYICONDATA locally on the stack it works fine.

.h
#pragma once


class CTrayIcon
{
public:
	CTrayIcon(void);
	virtual ~CTrayIcon(void);

	void OnCreate(HWND parent, UINT uCallbackMessage, HICON icon = NULL);
protected:

	NOTIFYICONDATA	 m_nidSystrayIcon;

};


.cpp
void CTrayIcon::OnCreate(HWND parent, UINT uCallbackMessage, HICON icon)
{
	m_hParentWnd	   = parent;
	m_hIcon			   = icon;
	m_uCallbackMessage = uCallbackMessage;

	memset(&m_nidSystrayIcon, 0, sizeof(m_nidSystrayIcon));
	m_nidSystrayIcon.cbSize = sizeof(NOTIFYICONDATA);

	m_nidSystrayIcon.hIcon			  = m_hIcon;
	m_nidSystrayIcon.hWnd			  = m_hParentWnd;
	m_nidSystrayIcon.dwInfoFlags	          = NIIF_NONE;
	m_nidSystrayIcon.dwState		  = NIS_SHAREDICON;
	m_nidSystrayIcon.uVersion		  = NOTIFYICON_VERSION;
	m_nidSystrayIcon.uCallbackMessage = m_uCallbackMessage;

	Shell_NotifyIcon(NIM_SETVERSION, &m_nidSystrayIcon);
}


Is there some special initalization that I am missing? I downloaded an example app and there doesn seem to be anything that I am missing, but obviously there is something wrong. Any ideas?

Nicola.
Questioncan i store output from readdir() function in an array Pin
WindowsVsLinux20-Oct-09 2:48
WindowsVsLinux20-Oct-09 2:48 
AnswerRe: can i store output from readdir() function in an array Pin
Rajesh R Subramanian20-Oct-09 3:03
professionalRajesh R Subramanian20-Oct-09 3:03 
GeneralRe: can i store output from readdir() function in an array Pin
WindowsVsLinux20-Oct-09 3:30
WindowsVsLinux20-Oct-09 3:30 
Questionsal.h Pin
Hans Dietrich20-Oct-09 1:54
mentorHans Dietrich20-Oct-09 1:54 
AnswerRe: sal.h Pin
Rajesh R Subramanian20-Oct-09 2:09
professionalRajesh R Subramanian20-Oct-09 2:09 
QuestionThreading Pin
ratprita20-Oct-09 1:27
ratprita20-Oct-09 1:27 
AnswerRe: Threading Pin
Richard MacCutchan20-Oct-09 1:44
mveRichard MacCutchan20-Oct-09 1:44 
GeneralRe: Threading Pin
ratprita20-Oct-09 22:01
ratprita20-Oct-09 22:01 
GeneralRe: Threading Pin
Richard MacCutchan20-Oct-09 23:59
mveRichard MacCutchan20-Oct-09 23:59 
AnswerRe: Threading Pin
buf102420-Oct-09 2:07
buf102420-Oct-09 2:07 
Questiondoes parenthesis reduce efficiency if used only for readability? Pin
jianzhuhuai20-Oct-09 1:11
jianzhuhuai20-Oct-09 1:11 
AnswerRe: does parenthesis reduce efficiency if used only for readability? Pin
Hans Dietrich20-Oct-09 1:17
mentorHans Dietrich20-Oct-09 1:17 
AnswerRe: does parenthesis reduce efficiency if used only for readability? Pin
Maximilien20-Oct-09 3:19
Maximilien20-Oct-09 3:19 
Questiontstring? Pin
Sauce!20-Oct-09 0:47
Sauce!20-Oct-09 0:47 
AnswerRe: tstring? Pin
Cedric Moonen20-Oct-09 0:52
Cedric Moonen20-Oct-09 0:52 
AnswerRe: tstring? Pin
Stuart Dootson20-Oct-09 1:10
professionalStuart Dootson20-Oct-09 1:10 
GeneralRe: tstring? Pin
Sauce!20-Oct-09 1:28
Sauce!20-Oct-09 1:28 

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.