CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: amarcode

Page 1 of 4 1 2 3 4

Search: Search took 0.02 seconds.

  1. Replies
    18
    Views
    2,400

    Re: Error in Recordset

    You can pass NULL parameter to the CRecordset Open function. In this case the default SQL statement is used, but you have to specify this statement in derived from CRecordset class function...
  2. Replies
    18
    Views
    2,400

    Re: Error in Recordset

    It's not true. The CRecordset class doesn't do it for you. You have to specify the select statement in the recordset open function.
  3. Replies
    18
    Views
    2,400

    Re: Error in Recordset

    Use the Class Wizard to generate your recordset files. In your files the macros in *.cpp (AFX_FIELD_INIT, AFX_FIELD_MAP AFX_FIELD) and *.h (AFX_FIELD, AFX_VIRTUAL) are missed. I have attached sample...
  4. Replies
    4
    Views
    1,100

    Re: MFC Bug or My Bug

    Also specify the lpszSockAddress (third parameter in Create function) as a pointer to a string containing the network address of the connected socket.
  5. Replies
    4
    Views
    1,100

    Re: MFC Bug or My Bug

    Call the AfxInitSocket() function only once in your CWinApp::InitInstance.
  6. Replies
    18
    Views
    2,400

    Re: Error in Recordset

    Your recordset files are not complete. Use Class Wizard to generate these files (View->ClassWizard->Add Class->New).
  7. Replies
    18
    Views
    2,400

    Re: Error in Recordset

    Could you post the CMyProjectClass files?
  8. Replies
    18
    Views
    2,400

    Re: Error in Recordset

    This code should help you to find the problem with the exception.


    try
    {
    CMyProjectClass rs(&myDatabase);
    rs.Open(CRecordset::snapshot,_T("Select proj_num, contact_name from...
  9. Replies
    18
    Views
    2,400

    Re: Error in Recordset

    You have to derive your recordset from the CRecordset class and bind all columns you need to the variables prior to call the recordset’s Open member function. Use the ClassWizard to create a...
  10. Replies
    2
    Views
    659

    Re: Printer Paper Oritentation problem!

    I forgot to say that SetOrientation() function should be declared in your application class derrived from CWinApp. HGLOBAL m_hDevMode is protected member of the CWinApp class.
  11. Replies
    2
    Views
    659

    Re: Printer Paper Oritentation problem!

    The function shown below sets the orientation of the paper for a printer. Call this function before CView::OnFilePrint() and CView::OnFilePrintPreview() calls.


    BOOL SetOrientation(BOOL bLandFl)...
  12. Replies
    42
    Views
    7,094

    Re: Exiting a Do-While loop

    The PeekMessage, DispatchMessage and TranslateMessage functions use MSG type not UINT as parameters. Try this :


    do
    {
    MSG msg;
    while ( PeekMessage (&msg, NULL, 0, 0, PM_REMOVE) )
    {...
  13. Re: Number of days between two filetime structures...

    FILETIME ft1, ft2;
    COleDateTime ot1(ft1);
    COleDateTime ot2(ft2);
    COleDateTimeSpan otspan = ot2-ot1;
    otspan.GetTotalDays();
  14. Re: cannot edit edit-box after setfocus (non-MFC)

    "The WM_INITDIALOG message is the first message the dialog box procedure receives. If the dialog box procedure returns TRUE, the Windows sets the input focus to the first child window control in the...
  15. Re: cannot edit edit-box after setfocus (non-MFC)

    The attached is a working example. Try to set the editbox as a first control on the dialog (Layout->Tab Order).
  16. Re: cannot edit edit-box after setfocus (non-MFC)

    Is this code working well now?
  17. Re: cannot edit edit-box after setfocus (non-MFC)

    It works well for me.

    You don't need to pass the ID of editbox as a parameter. You know the value, so you can set the second parameter to this value in GetDlgItem instead of using lParam.
    Could...
  18. Re: cannot edit edit-box after setfocus (non-MFC)

    The WS_TABSTOP has nothing to do with your problem. Sorry for my previous message.
    You can call the DialogBoxParam with dwInitParam parameter set to the ID of your editbox and call SetFocus on init...
  19. Re: cannot edit edit-box after setfocus (non-MFC)

    Use WS_TABSTOP flag with your editbox control.
  20. Replies
    2
    Views
    932

    Re: killing a service

    I usually use ATL COM AppWizard to create a service application and call PostThreadMessge(dwThreadID,WM_QUIT,0,0) to stop the service from inside the service program.
    The dwThreadID parameter is a...
  21. Replies
    2
    Views
    1,102

    Re: Displaying main menu as a popup menu???

    If you want to display the main menu as a popup menu follow these steps:
    1. Create a temporary popup menu (menuPopup)
    2. Append all popup submenus from the main menu to this menu
    3. Call...
  22. MFC Edit Control: How to know when text is pasted from clipboard to 'CEdit' control?

    Q: How to know when text is pasted from clipboard to 'CEdit' control?

    A: In the destination application derive all edit controls from 'CEdit' and override 'OnChar()' and 'OnContextMenu()':


    ...
  23. Replies
    2
    Views
    2,712

    Re: Trouble exiting worker thread.

    You call WaitCommEvent with lpOverlapped = NULL. It is a blocking call and it means the thread function waits for an event to occur (EV_RXCHAR in your example). If there are no input bytes the...
  24. Replies
    5
    Views
    1,036

    Re: Problem resizing control in dialog!

    I know it. I only wanted to point that the code shuld be placed in the dialog box class.
  25. Thread: ODBC DB Path

    by amarcode
    Replies
    5
    Views
    1,101

    Re: ODBC DB Path

    If you use the MS Access database (MDB) you can parse the ODBC connect string for "...;DBQ=\YourDatabasePath\YourDatabaseFile.mdb;..." substring.


    CDatabase db;
    db.Open("YourDSN");
    CString s =...
Results 1 to 25 of 90
Page 1 of 4 1 2 3 4





Click Here to Expand Forum to Full Width

Featured