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
J

Jarley D G

@Jarley D G
About
Posts
13
Topics
4
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • small error
    J Jarley D G

    I´m not using it, I just #include "FolderDlg.h" and use it this way : BOOL CDlgEnsayoObs::BrowseForDataStore () { CCableOkApp* pApp = (CCableOkApp*)AfxGetApp(); CFolderDialog dlg(this); CString path; LPCITEMIDLIST pidl; BOOL bRet = FALSE; pidl = dlg.BrowseForFolder(_T("Seleccione el directorio de Almacén de datos"), BIF_USENEWUI |BIF_RETURNONLYFSDIRS | BIF_STATUSTEXT ,NULL ,TRUE); path = dlg.GetPathName(pidl); if (path.IsEmpty ()) { return bRet; } else { pApp->m_sDataFilePath = path + "\\"; pApp->m_sDataStorePath = path + "\\"; SetDlgItemText(IDC_FILEPATH, "Seleccione un grupo de cables o Dir. de captura"); SetDlgItemText(IDC_DATASTORE, pApp->m_sDataStorePath); pApp->m_DataBase.SetDataStore(pApp->m_sDataStorePath); bRet = TRUE; } dlg.FreePIDL(pidl); // liberar PIDL cuando se termina--importante!! return bRet; } In my project is not _DbgName in any place. It´s only in the DiLascia code inside a debug.h file. I´m not including nor added to my project this two files, debug.h and debug.cpp. I´m only including FolderDlg.h, FolderDlg.cpp, where the functions I want to use are declared/implemented. Anyway FolderDlg header is already including debug.h ... This one debug.h : //////////////////////////////////////////////////////////////// // PixieLib(TM) Copyright 1997-2005 Paul DiLascia // If this code works, it was written by Paul DiLascia. // If not, I don't know who wrote it. // // --- // General purpose debugging utilities. // #ifndef _DEBUG_H #define _DEBUG_H #ifndef countof #define countof(x) (sizeof(x)/sizeof(x[0])) #endif #ifdef _DEBUG // tell linker to look in ole32 lib (for StringFromClsid) #pragma comment(linker, "/defaultlib:ole32.lib") ////////////////// // The following stuff is for getting human-readable names of things so // you can show them in TRACE statements. For example, // // TRACE("Window is: %s\n", _TR(pWnd)); // // Will generate output showing the name and title of the window, etc. // // Macro _TR casts _DbgName(x) to LPCTSTR for use with in printf so you // can write // // TRACE("Message is %s\n", _TR(uMsg)); // // instead of // // TRACE("Message is %s\n", (LPCTSTR)_DbgName(uMsg)); // #define _TR(x) (LPCTSTR)_DbgName(x) // overloaded fns to get names of things. extern CString _DbgName(CWnd* pWnd); // get name of window extern CString _DbgName(UINT uMsg); // ... WM_ message extern CString _DbgName(REFIID iid); // get name of COM i

    C / C++ / MFC c++ visual-studio help question learning

  • small error
    J Jarley D G

    In fact it is in debug configuration where the linker errors came. When I compile in release, all is ok... So I´m missing something in my debug config? this line is a comment in the code // You must link shlwapi.lib for StrRetToBuf could this be the problem? If it is... how do I link shlwapi.lib ? thx again. jdg

    --------------------------------------------- "Don't panic!. All will become clear in time" WYS Is Not always WYG

    C / C++ / MFC c++ visual-studio help question learning

  • small error
    J Jarley D G

    Done :) thanks. ups... sorry resource explorer! was hidden.. stupid me. =/ Well the previous part compiled ok, but I´m using too this code from MSDN by Paul DiLascia where he encapsulated SHBrowseForFolder in a class FolderDlg... http://msdn.microsoft.com/msdnmag/issues/05/06/CAtWork/default.aspx At VS2003 it was working ok... but now I´m having this fatal error... So my project still can´t compile :( please any help apretiated . thanks in advance. FolderDlg.obj : error LNK2019: unresolved external symbol "class ATL::CStringT > > __cdecl _DbgName(long)" (?_DbgName@@YA?AV?$CStringT@DV?$StrTraitMFC_DLL@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@J@Z) referenced in function "protected: virtual long __stdcall CFolderDialog::QueryInterface(struct _GUID const &,void * *)" (?QueryInterface@CFolderDialog@@MAGJABU_GUID@@PAPAX@Z) FolderDlg.obj : error LNK2019: unresolved external symbol "class ATL::CStringT > > __cdecl _DbgName(struct _GUID const &)" (?_DbgName@@YA?AV?$CStringT@DV?$StrTraitMFC_DLL@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@ABU_GUID@@@Z) referenced in function "protected: virtual long __stdcall CFolderDialog::QueryInterface(struct _GUID const &,void * *)" (?QueryInterface@CFolderDialog@@MAGJABU_GUID@@PAPAX@Z) FolderDlg.obj : error LNK2019: unresolved external symbol "public: __thiscall CInterfaceNames::CInterfaceNames(struct DBGINTERFACENAME *,unsigned int)" (??0CInterfaceNames@@QAE@PAUDBGINTERFACENAME@@I@Z) referenced in function "void __cdecl `dynamic initializer for '_initMyDBI''(void)" (??__E_initMyDBI@@YAXXZ) .\Debug/adquisition.exe : fatal error LNK1120: 3 unresolved externals

    --------------------------------------------- "Don't panic!. All will become clear in time" WYS Is Not always WYG

    C / C++ / MFC c++ visual-studio help question learning

  • small error
    J Jarley D G

    Hi all I have loaded (a copy just in case) of my project from VS2003 at VS 2005, it was converted fine with just a few errors that I fixed but I still have this one that I dont understand. I´m not an expert, I´ve few months programming MFC self learning and still a lot to learn. The error Line : static CALLBACK CallbackProc(HWND hwnd, UINT msg, LPARAM lp, LPARAM lpData); The compiler error: error C4430: missing type specifier - int assumed. Note: C++ does not support default-int Can I continue with my MFC project at VS2005 with no problems at all? Why I cant see my dialogs, main form , etc.. just the code? Where are they!!? thx in advance. Jdg

    --------------------------------------------- "Don't panic!. All will become clear in time" WYS Is Not always WYG

    C / C++ / MFC c++ visual-studio help question learning

  • Edit control
    J Jarley D G

    Im on it testing both, just wanted to know a better way. thx

    --------------------------------------------- "Don't panic!. All will become clear in time" WYS Is Not always WYG

    C / C++ / MFC database algorithms question

  • Edit control
    J Jarley D G

    thx :)

    --------------------------------------------- "Don't panic!. All will become clear in time" WYS Is Not always WYG

    C / C++ / MFC database algorithms question

  • Edit control
    J Jarley D G

    Hello I´m trying to do this : A user starts to write his username in an editcontrol, and as he types Im searching in a database finding any coincidences with other data I have... If found one i will show it in other editcontrol else I will disable it. So at what event from the editcontrol should I put my code? EN_UPDATE ? EN_CHANGE ? or this is not the best way..? thx in advance...

    --------------------------------------------- "Don't panic!. All will become clear in time" WYS Is Not always WYG

    C / C++ / MFC database algorithms question

  • Bitmap transparency at picture_control [modified]
    J Jarley D G

    ok thanks all, i will try all the methods, and read the site as well.. thx..

    C / C++ / MFC visual-studio csharp graphics question

  • Bitmap transparency at picture_control [modified]
    J Jarley D G

    Hello I´m inserting a bitmap image in my dialog with a picture control, and i want it to be transparent like when you insert an icon in a dialog, and you set the background colour to some kind of green at visual studio icon editor and it do the trick. So, what background color should I use with bitmaps? btw I´m using Visual Studio 2003 IDE. thank´s. -- modified at 8:53 Thursday 24th August, 2006

    C / C++ / MFC visual-studio csharp graphics question

  • How do I update my main window from a dialog? [modified]
    J Jarley D G

    It works now!! thanks a lot for your help :)

    C / C++ / MFC c++ question announcement career learning

  • How do I update my main window from a dialog? [modified]
    J Jarley D G

    Yes, is dialog based and I have doc/view classes too. The wizard created me a View class, and i read that there I should do my drawings, I´m going by the book... Hope it isn´t wrong :S ... I just realize that when I logon the user and then resize the main window manually, the new user is displayed correctly. It works :) but how do I call that ::OnPaint method in my View Class from the logon dialog when I press Ok? That´s what i don´t know to do... thank´s

    C / C++ / MFC c++ question announcement career learning

  • How do I update my main window from a dialog? [modified]
    J Jarley D G

    It´s not related, just that in this class is where i do all my drawing stuff and the first time i write the user at the main window, I do it from this class.

    class CRegisterAppView : public CScrollView
    {
    protected: // Crear sólo a partir de serialización
    CRegisterAppView();
    DECLARE_DYNCREATE(CRegisterAppView)
    .
    .
    .
    }

    thanks

    C / C++ / MFC c++ question announcement career learning

  • How do I update my main window from a dialog? [modified]
    J Jarley D G

    Hi, I´m new here and im self learning vc++ and mfc programming, add to this that I´m spanish speaking native, so please excuse my english, I will do my best so you all can understand me. Well, what I´m doing in resume is this : I have a CDialog logon screen in my program, where the user enter his password and username. So I need to save the user and update the Main window with who just logged in. By the way, I´m working in a Dialog Based App. So in my class RegisterApp : public CWinApp I do this :

    class RegisterApp : public CWinApp
    {
    public:
    RegisterApp();
    CString sActiveUser;//A member var to save the active user.
    .
    .

    I Initialize it :

    RegisterApp::RegisterApp()
    {
    sActiveUser = "No user logged";
    }

    Then at my RegisterAppView::OnPaint() I show before the login that there´s no user: I can see it well at the Main window that is at the background, and at front "OnTop" I got the little logon window.

    RegisterApp* pApp;
    pApp = (RegisterApp*)AfxGetApp();
    dc.TextOut(105,60,"Usuario activo : " + pApp->sActiveUser);

    I don´t know if this is the best way, but it works and shows what I want at this moment "No user logged" . Now, when the user logs in I do this :

    bool CDlgLogon::FiltraDatos()
    {
    RegisterApp* pApp;
    pApp = (RegisterApp*)AfxGetApp();
    CString sIdUsuario;
    GetDlgItemText(IDC_EDTLOGONUSER, sIdUsuario);
    .
    .//some code to check the user...
    .

        pApp->sActiveUser = sIdUsuario;
    

    .
    .
    }

    Ok, I´ve just updated sActiveUser, I got the user in a var out of the logon dialog function, So I think I will not loose it(I´m right?), but now I need to update the Main Window with this value, in graphical mode using dc.TextOut... Is correct that I should call the RegisterAppView::OnPaint() method again to show the actual user?. If it is, How do I do that from my dialog? Is this the correct way to do this? thanks in advance :) Jarley "Don't panic!. All will become clear in time"

    C / C++ / MFC c++ question announcement career learning
  • Login

  • Don't have an account? Register

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