Click here to Skip to main content
15,889,216 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
PraiseRe: C, Win32: l need help getting user input Pin
Member 1213944218-Jan-16 11:10
Member 1213944218-Jan-16 11:10 
QuestionContext menu style of Shell in Windows 10 Pin
rikka0w016-Jan-16 19:21
rikka0w016-Jan-16 19:21 
QuestionC function to call 5 different functions Pin
Member 1213438816-Jan-16 5:55
Member 1213438816-Jan-16 5:55 
AnswerRe: C function to call 5 different functions Pin
Richard Andrew x6416-Jan-16 6:48
professionalRichard Andrew x6416-Jan-16 6:48 
GeneralRe: C function to call 5 different functions Pin
Member 1213438816-Jan-16 9:18
Member 1213438816-Jan-16 9:18 
QuestionCheck and uninstall a driver programatically using C++ Pin
Prasanth.outofboxt14-Jan-16 22:09
Prasanth.outofboxt14-Jan-16 22:09 
AnswerRe: Check and uninstall a driver programatically using C++ Pin
Jochen Arndt14-Jan-16 22:30
professionalJochen Arndt14-Jan-16 22:30 
QuestionWin32: l need help on filling a combo box [Solved] Pin
Member 1213944214-Jan-16 10:53
Member 1213944214-Jan-16 10:53 
C#
Am creating application and l need to fill a combo box list. However, l was able to do all and is working but whenever l filling the last combobox, l get an exception as below.

First-chance exception at 0x7789dba9 in Unical PTUME.exe: 0xC0000005: Access violation reading location 0x00000001.
Unhandled exception at 0x7789dba9 in Unical PTUME.exe: 0xC000041D: An unhandled exception was encountered during a user callback.

What does it mean and how can l correct it?

code snippet below:

case WM_CREATE:
DialogBox(((LPCREATESTRUCT)lParam)->hInstance, MAKEINTRESOURCE(IDD_CHOICEBOX),hWnd,choicedlg);//Dialog proc.
return 0;

INT_PTR CALLBACK choicedlg(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam){
int i=0; static int firsttime=1; PWSTR input=NULL;
switch(message)
{
case WM_INITDIALOG:
//Add faculties to the combo list
for(i=0; i<=sizeof(Choice)/sizeof(Choice[0]); i++){
SendDlgItemMessage(hwnd,IDC_UNICALPTUME_FACULTY,CB_ADDSTRING,0,(LPARAM)Choice[i]);
}
for(i=0; i<=sizeof(Course)/sizeof(Course[0]); i++){
SendDlgItemMessage(hwnd,IDC_UNICALPTUME_SUBJECT1,CB_ADDSTRING,0,(LPARAM)Course[i]);
SendDlgItemMessage(hwnd,IDC_UNICALPTUME_SUBJECT2,CB_ADDSTRING,0,(LPARAM)Course[i]);
SendDlgItemMessage(hwnd,IDC_UNICALPTUME_SUBJECT3,CB_ADDSTRING,0,(LPARAM)Course[i]);
SendDlgItemMessage(hwnd,IDC_UNICALPTUME_SUBJECT4,CB_ADDSTRING,0,(LPARAM)Course[i]);
SendDlgItemMessage(hwnd,IDC_UNICALPTUME_SUBJECT5,CB_ADDSTRING,0,(LPARAM)Course[i]);
SendDlgItemMessage(hwnd,IDC_UNICALPTUME_SUBJECT6,CB_ADDSTRING,0,(LPARAM)Course[i]);
}
for(i=0; i<=sizeof(Year)/sizeof(Year[0]); i++){
SendDlgItemMessage(hwnd,IDC_UNICALPTUME_YEAR1,CB_ADDSTRING,0,(LPARAM)Year[i]);
SendDlgItemMessage(hwnd,IDC_UNICALPTUME_YEAR2,CB_ADDSTRING,0,(LPARAM)Year[i]);
SendDlgItemMessage(hwnd,IDC_UNICALPTUME_YEAR3,CB_ADDSTRING,0,(LPARAM)Year[i]);
SendDlgItemMessage(hwnd,IDC_UNICALPTUME_YEAR4,CB_ADDSTRING,0,(LPARAM)Year[i]);
SendDlgItemMessage(hwnd,IDC_UNICALPTUME_YEAR5,CB_ADDSTRING,0,(LPARAM)Year[i]);
SendDlgItemMessage(hwnd,IDC_UNICALPTUME_YEAR6,CB_ADDSTRING,0,(LPARAM)Year[i]);
} //etc
However, if l add the code below, l always get error message as above.


for(i=0; i<=sizeof(Time)/sizeof(Time[0]); i++){
SendDlgItemMessage(hwnd,IDC_UNICALPTUME_TIME,CB_ADDSTRING,0,(LPARAM)Time[i]);
}// problem code


modified 18-Jan-16 17:12pm.

AnswerRe: Win32: l need help on filling a combo box Pin
Richard Andrew x6414-Jan-16 12:09
professionalRichard Andrew x6414-Jan-16 12:09 
AnswerRe: Win32: l need help on filling a combo box Pin
Jochen Arndt14-Jan-16 21:23
professionalJochen Arndt14-Jan-16 21:23 
PraiseRe: Win32: l need help on filling a combo box Pin
Member 1213944215-Jan-16 8:09
Member 1213944215-Jan-16 8:09 
QuestionOpen the file but do not save the args Pin
honor3us13-Jan-16 8:42
honor3us13-Jan-16 8:42 
AnswerRe: Open the file but do not save the args Pin
jeron113-Jan-16 9:18
jeron113-Jan-16 9:18 
GeneralRe: Open the file but do not save the args Pin
honor3us14-Jan-16 0:46
honor3us14-Jan-16 0:46 
SuggestionRe: Open the file but do not save the args Pin
David Crow13-Jan-16 9:33
David Crow13-Jan-16 9:33 
GeneralRe: Open the file but do not save the args Pin
honor3us14-Jan-16 0:56
honor3us14-Jan-16 0:56 
QuestionRe: Open the file but do not save the args Pin
David Crow14-Jan-16 2:33
David Crow14-Jan-16 2:33 
AnswerRe: Open the file but do not save the args Pin
honor3us14-Jan-16 3:51
honor3us14-Jan-16 3:51 
AnswerRe: Open the file but do not save the args Pin
David Crow14-Jan-16 3:52
David Crow14-Jan-16 3:52 
SuggestionRe: Open the file but do not save the args Pin
k505413-Jan-16 11:39
mvek505413-Jan-16 11:39 
GeneralRe: Open the file but do not save the args Pin
honor3us14-Jan-16 0:57
honor3us14-Jan-16 0:57 
GeneralRe: Open the file but do not save the args Pin
k505414-Jan-16 3:52
mvek505414-Jan-16 3:52 
AnswerRe: Open the file but do not save the args Pin
honor3us15-Jan-16 2:44
honor3us15-Jan-16 2:44 
SuggestionRe: Open the file but do not save the args Pin
David Crow15-Jan-16 3:49
David Crow15-Jan-16 3:49 
Questiondoubt in typdef segregation one class in two Pin
narsi8112-Jan-16 18:50
narsi8112-Jan-16 18:50 

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.