Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
M

mvworld

@mvworld
About
Posts
26
Topics
17
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Dialog Box Problem
    M mvworld

    I figured that out thanks. But the problem now is that I need a menu bar for one user category and no menu for the other user category. By default the dialog box loads a menu bar, and I want to remove it when the user 2 enters. So I did the following CMenu* menu = GetSystemMenu(TRUE); menu->DestroyMenu(); But the program crashes! What do I do? Thanks, Mike

    C / C++ / MFC question help

  • Dialog Box Problem
    M mvworld

    I have a dialog based application which the user accesses through a password. Now there are 2 categories of users and depending on the login and password the application has to display 2 different user screens. How do I do this? Also when I first wrote this application I had just one user in mind so all the code is present in the dialog class CApplicationDlg. Is it possible for me to hide all the controls on this dialog box and create a new user screen on the same dialog box when the 2nd user type logs in? Thanks Mike.

    C / C++ / MFC question help

  • Radio Box
    M mvworld

    If I have 2 radio boxes and I want to make sure the user can check only one of them at a time (ie if the user checks one, the other gets automatically unchecked).....then how do I do this? Thanks.

    C / C++ / MFC question

  • Weird Problem
    M mvworld

    Well I have a weird problem. I have declared a stucture called BrowseBoxStruct in the header file BBDefinition.h as follows #ifndef __BBOXSTRUCT__ #define __BBOXSTRUCT__ struct MyStruct { CString column_name; int column_width; _variant_t table_column_name; }; typedef MyStruct BrowseBoxStruct; #endif Now I want to pass it to the constructor of a class (CBrowse in Browse.h and Browse.cpp) so I changed the standard constructor for the class as follows. CBrowse(CWnd* pParent = NULL, BrowseBoxStruct* pBbx = NULL); and in the cpp file I have CBrowse::CBrowse(CWnd* pParent /*=NULL*/, BrowseBoxStruct* pBbx) : CDialog(CBrowse::IDD, pParent){ //{{AFX_DATA_INIT(CBrowse) // NOTE: the ClassWizard will add member initialization here //}}AFX_DATA_INIT} } But when I build the application I get the follwoing errors c:\coursemanager\browse.h(18) : error C2629: unexpected 'class CBrowse (' c:\coursemanager\browse.h(18) : error C2238: unexpected token(s) preceding ';' C:\CourseManager\Browse.cpp(20) : error C2511: 'CBrowse::CBrowse' : overloaded member function 'void (class CWnd*, struct MyStruct*)' not found in 'CBrowse'C:\CourseManager\Browse.cpp(94) : fatal error C1004: unexpected end of file found Please tell me what is going wrong? I included the header file for the structure in the cpp file of my class. I did not forget to add ; in the header file BBDefinition which defines the structure. Still what is going wrong? Mike :(

    C / C++ / MFC help question c++

  • 2 Questions
    M mvworld

    I have developed a dialog box based application for a college project. But midway through the project, my professor wants me to have a menu bar in the application. I have already written much code, so it would be a pain for me to start from scratch. So I have 2 question: q1)Is it possible to have a menu in a dialog box based application? q2)If yes, then is there a way for me to add a menu bar to my existing project or create a new project and reuse all my existing dialog boxes, resources and code? Thanks, Mike

    C / C++ / MFC question

  • Combo Box Problem
    M mvworld

    Hey, I did as you told me. But now the application still mysteriously crashes. What I want to do is that just before the child appears, a function in the main dialog box (the parent) provides the child with stuff the child needs to show in the combo box. Since in the child I have a pointer to the parent, so I used it to call the function which should provide the child with the data for the combo box. But somehow the application crashes! Are we allowed to call other functions inside the OnInitDialog/OnInitInstance?

    C / C++ / MFC question help

  • Combo Box Problem
    M mvworld

    But there is no OnInitDialog() in my child dialog class!! Even when I tried to override OnInitDialog (hoping it was there in CDialog) it did not have it already defined in the base class.

    C / C++ / MFC question help

  • Combo Box Problem
    M mvworld

    Well the application crashes. I have a main dialog box and in one of the functions I create a child dialog box which has the member variable m_ComboBox as public. So in my main dialog box I have CChildDialog ChildDlg; ChildDlg.m_ComboBox.AddString("Some Text"); ChildDlg.DoModal(); And then when I run this application, it crashes. So to test again I tried to Add a string to the combobox in the constructor of my child dialog but the application still crashed! What shall I do?

    C / C++ / MFC question help

  • Combo Box Problem
    M mvworld

    Hello, Well I have this funny problem. I want to add items to my combo box in a child dialog box from my parent dialog box just before the child is shown. To do this I have the following line ChildDlg.m_ComboBox.AddString("Some Text"); I even tried ChildDlg.m_ComboBox.InsertString(0, "Some Text"); I made sure too that the member variable m_ComboBox in the class ChildDlg referred to the contro (not the value) of my Combo box. What is wrong? Thanks, Mike

    C / C++ / MFC question help

  • Child Dialog Box
    M mvworld

    If I have a main dialog box, and On the click of a button I want a child dialog box to appear...what do I do? I created a dialog box (with type child) and in the BNClicked method of the button I wrote. void CMainDlg::OnAddChild() { CChildDlg* ChildBox = new CChildDlg; ChildBox->DoModal(); } But the images of the Main and the Child dialog boxes got superimposed (and got mixed up) during runtime. So someone suggested the following, but it still does not work! void CMainDlg::OnAddChild() { CChildDlg* ChildBox = new CChildDlg; if(!::IsWindow(GetSafeHwnd())) ChildBox->Create(IDD_AJOUT, this); ChildBox->ShowWindow(SW_SHOW); } Please tell me how do I get my child dialog box to show properly?

    C / C++ / MFC question

  • Dialog Box Problems
    M mvworld

    Shall I create the child dialog box in the constructor of the Main Dialog box or in the OnInitDialog? When I created it in the OnInitDialog then after I closed the Main Dialog Box I could still see the image of the child dialog box (not the box though). This does not happen when I create the child dialog box in the constructor of the Main Dialog Box. Any explanations?

    C / C++ / MFC question

  • Looking for Resources on Sequent Calculus
    M mvworld

    Hi, Please tell me of sites where I can find an overview of Sequent Calculus. Also if you know some good books on this subject then let me know. Thanks, Mike.

    Article Writing

  • Help needed for xemacs code!
    M mvworld

    Hi, I have to work on a project related to xemacs. Now my code loads some dll's from within xemacs and my prof wants me to unload them before xemacs is shut. So I have to find out exactly which part of the code is executed just before exit, and I dont really know how to do this. Can anyone tell me if there are any tips to follow when trying to understand the code of a big project with loads of files? And more specifically can anyone tell me which code (also which file) is executed just before exit? Thanks in advance. Mayank. :confused: :confused: :confused: :confused: :confused: PS - I am using xemacs-21.1.4, source can be found at http://ftp.xemacs.org/xemacs-21.1/xemacs-21.1.4.tar.gz

    C / C++ / MFC help tutorial question

  • __asm?? Some help me!!
    M mvworld

    Hi, ok how do I access contents of a structure from inside asm code? For example I have a structure (with which I will make a list) typedef struct _LIST{ DWORD value; struct _LIST *next; }list; then I have a pointer of this structure list *my_list; After having input the data in this list, how can I traverse the list from inside __asm to read the variable "value" for each of the structures? i.e. How do I read my_list->value and my_list->next from inside __asm block? Thanks

    C / C++ / MFC question help tutorial

  • Programming Problem
    M mvworld

    Hi thanks again :) But in your code you use all int arguments. Only the number of arguments is changing here. But I want to be able to multiple type of arguments!!! like float, char, long etc....possibly all of them!! is that possible with va_args?

    Article Writing help performance question

  • Programming Problem
    M mvworld

    Can you show me an example? Thanks:)

    Article Writing help performance question

  • Programming Problem
    M mvworld

    Hi I have to write a C program to take any number of arguments of any type from the user at runtime. I dont want to declare arrays of all the data types as that would be wastage of memory. Is there an efficient way to input any number of arguments from the user of any type? Please help as this is a part of my college project!! Thanks:confused:

    Article Writing help performance question

  • What is wrong with this code?
    M mvworld

    #include void callDllFunc(char *, char *, ...); void main() { char *szDllName = "USER32.DLL"; char *szFuncName = "SetWindowTextA"; char szDataType[40]; int numArgs, counter; void *receptor[20]; printf("Enter the number of arguments SetWindowTextA takes: "); scanf("%d", &numArgs); for(counter = 0; counter < numArgs; counter++) { printf("Enter the datatype of arguement %d: ", counter+1); scanf("%s", szDataType); switch(*szDataType) { case 'i': printf("Enter an int value: "); scanf("%d", receptor[counter]); break; default: break; } } } I want to take a variable number of arguments of any time. The user in this case wants to call a function within a Dll and he knows the number and types of the arguments. My problem is how do I take those arguments from the use and pass them on to the Dll? (callDllFunc will take the name of the Dll, the name of the function, and the arguments to be passed to the Dll function)

    C / C++ / MFC question help

  • Using the ellipsis (...)
    M mvworld

    Can someone show me an example program on the use of the ellipsis (...) to be able to recieve an unspecified number/types of arguemtns at run time. :)

    C / C++ / MFC tutorial

  • Calling a dll function from __asm blocks?
    M mvworld

    Hi I am trying to call a DLL (for testing I use the SetWindowTextA function from User32.dll) Everything seems correct to me...and the program compiles and links fine, except that on executing it, it given an illegal operation. I have checked that SetWindowTextA is in User32.dll, so I guess it should work? Here is the code: #include #define TAILLE_MAX 40 void main() { char *szFuncName = "SetWindowTextA"; char *szDllName = "User32.dll"; HINSTANCE hLibrary; HWND hwnd; char szOldWndTitle[TAILLE_MAX]; char *szNewWndTitle = "Changed Title"; BOOL RetVal; GetConsoleTitle(szOldWndTitle, TAILLE_MAX); hwnd = FindWindow(NULL, szOldWndTitle); __asm { push szDllName call LoadLibrary mov hLibrary, eax push szFuncName push hLibrary call GetProcAddress ;eax recieves function pointer push szNewWndTitle push hwnd call eax mov RetVal, eax push hLibrary call FreeLibrary } } Any ideas what is wrong? Thanks in advance :)

    C / C++ / MFC question testing beta-testing
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups