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

C / C++ / MFC

 
GeneralRe: Returning free memory to system Pin
Maximilien28-May-04 5:02
Maximilien28-May-04 5:02 
GeneralRe: Returning free memory to system Pin
David Crow28-May-04 7:23
David Crow28-May-04 7:23 
GeneralExcel 2003 programming Pin
super28-May-04 3:51
professionalsuper28-May-04 3:51 
GeneralAdd Most Recently Used files(MRU) in any application Pin
nitinveda28-May-04 2:46
nitinveda28-May-04 2:46 
GeneralRe: Add Most Recently Used files(MRU) in any application Pin
David Crow28-May-04 3:07
David Crow28-May-04 3:07 
GeneralRe: Add Most Recently Used files(MRU) in any application Pin
nitinveda28-May-04 3:44
nitinveda28-May-04 3:44 
GeneralRe: Add Most Recently Used files(MRU) in any application Pin
jmkhael28-May-04 4:10
jmkhael28-May-04 4:10 
GeneralRe: Add Most Recently Used files(MRU) in any application Pin
nitinveda28-May-04 20:50
nitinveda28-May-04 20:50 
Please find attached code, Let me explain what I am doing.

I am storing file names in an array List[],Then I want to insert stored value in File menu at 10th position.For this I am using.

InsertMenuItem(ghMenuBar,10,TRUE,&MI);

Following error is coming

"The parameter is incorrect"


if(strcmpi(List[Count],szFileTitle) != 0)
{
strcpy(List[Count],szFileTitle);
// Result = GetMenuItemCount(ghMenuBar);


MI.fMask = MIIM_TYPE;
MI.fType =MFT_STRING;
MI.dwTypeData = List[Count];
MI.cch = strlen(List[Count]);


Result = InsertMenuItem(ghMenuBar,10,TRUE,&MI);

if(Result == 0)
{

FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
GetLastError(),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
(LPTSTR) &lpMsgBuf,
0,
NULL
);
// Display the string.
MessageBox( NULL, (LPCTSTR)lpMsgBuf, "Error", MB_OK | MB_ICONINFORMATION );
// Free the buffer.
LocalFree( lpMsgBuf );
}


DrawMenuBar(hMainWnd);

Count++;
if(Count > 3)
{
strcpy(List[0],List[1]);
strcpy(List[1],List[2]);
strcpy(List[2],List[3]);
strcpy(List[3],szFileTitle);
}

}


GeneralLinking preformance VS.NET compared to VS6 Pin
Björn Carlsson28-May-04 2:17
Björn Carlsson28-May-04 2:17 
Questionhow to set maxi,minimize button to propertysheet Pin
Member 101812828-May-04 2:13
Member 101812828-May-04 2:13 
AnswerRe: how to set maxi,minimize button to propertysheet Pin
Antti Keskinen28-May-04 5:21
Antti Keskinen28-May-04 5:21 
Generalneed help regarding CSocket Pin
Member 101812828-May-04 2:06
Member 101812828-May-04 2:06 
GeneralWSAEWOULDBLOCK Error Pin
jerry1211a28-May-04 1:00
jerry1211a28-May-04 1:00 
GeneralRe: WSAEWOULDBLOCK Error Pin
Mike Dimmick28-May-04 3:11
Mike Dimmick28-May-04 3:11 
GeneralRe: WSAEWOULDBLOCK Error Pin
Anonymous28-May-04 11:29
Anonymous28-May-04 11:29 
QuestionHow to load and display 8bit gray scale image Pin
Omar Alvi28-May-04 0:45
Omar Alvi28-May-04 0:45 
AnswerRe: How to load and display 8bit gray scale image Pin
Ryan Binns28-May-04 0:55
Ryan Binns28-May-04 0:55 
QuestionHow to load and display 8bit gray scale image Pin
Omar Alvi28-May-04 0:45
Omar Alvi28-May-04 0:45 
GeneralDatabase Application Design Pin
asv28-May-04 0:28
asv28-May-04 0:28 
GeneralRe: Database Application Design Pin
valikac28-May-04 14:00
valikac28-May-04 14:00 
GeneralRe: Database Application Design Pin
asv28-May-04 15:25
asv28-May-04 15:25 
Generalvisual c++ help hanging Pin
crazymike193828-May-04 0:27
crazymike193828-May-04 0:27 
GeneralRe: visual c++ help hanging Pin
jmkhael28-May-04 0:58
jmkhael28-May-04 0:58 
GeneralTaskbar icon mouse messages and keyboard modifiers Pin
cheesepirate28-May-04 0:24
cheesepirate28-May-04 0:24 
QuestionFunction template passed as typename argument? Pin
Indrawati28-May-04 0:12
Indrawati28-May-04 0:12 

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.