Hi, I want to show/hide my MFC Dialog from another class; Main App : HomeWorkApp Main Dlg : HomeWorkDlg #include "HomeWorkDlg.h" #include "HomeWorkApp.h" CWorkUser::CWorkUser() { // Initialize MFC Dialog here.. // How ?? MainDlg->ShowWindow(SW_SHOW); } CWorkUser::~CWorkUser() { // Finalize MFC Dialog here.. } Thanks..

Member Avatar
Member Avatar
+0 forum 1

Hi i am new to VC++, iam trying to implement the encoding of password **In Java ,** **byte[] saltedPassword = (password + getSalt()).getBytes();** **output :** ** SaltedPassword :[B@3eca90** in Java, saltedPassword get encoded value in the same way **i want to implement in VC++** How to do **Encoding in VC++**..? Please anyone help for me. Thanks in Advance..

Member Avatar
Member Avatar
+0 forum 1

I am trying to create a simple transparent window where I can draw with Direct2D. So far what I have done: 1. Created window 2. Set style to **WS_EX_LAYERED** 3. Set alpha color key as #FFF 4. Draw using Windows Graphics a white rectangle 5. Now window is transparent with per-pixel alpha 6. Then make a target out of the window and draw using Direct2D 7. Make **ALPHA_PREMULIPLIED** target 8. Clear with #FFF with 0.0f alpha (With 0.0 alpha to clear out the window apparently) 9. Window is now black and not transparent. After following all this, I stil can't …

Member Avatar
+0 forum 0

Hi Everyone I have been programming on Linux for about 8 years part time. I have learned many languages and I am not afraid of using them. However I have learned to fear build systems, operating systems and IDEs. I have been going around in circles for years with Gui WIdget toolkits. I have tried lots of them, FLTK, GTK, WxWidgets, QT etc, they are all fine for Linux but just don't feel right to me for Windows. I am concerned I will have cross platform issues, the binaries will be large and there will be a non native look …

Member Avatar
Member Avatar
+0 forum 2

How can i disable or hide mfc application taskbar icon? seems like "ShowInTaskBar = false";

Member Avatar
Member Avatar
+0 forum 4

Observe this code: TOOLBARINFO tbi = { 0 }; BUTTONINFO bi, *xBI; tbi.pTOI = pTOI; int x = 0, xSearchBox = 0, s = 0; BYTE xType = btNone; BOOL bAdd; for( ;*pszInfo; ) { bAdd = TRUE; memset(&bi, 0, sizeof bi); switch( *pszInfo ) { case bfButton: s++; bi.L = x + 4; if( xType==bfButton ) bi.L += 4; bi.R = bi.L + 24; bi.wFlags = xType = bfButton; if( *(pszInfo+1) ) { *++pszInfo; for( ;*(pszInfo+1) && bfActive<=*(pszInfo+1) && *(pszInfo+1)<=bfDisabled;*pszInfo++ ) bi.wFlags |= *pszInfo; if( *pszInfo && *pszInfo==':' ) { *++pszInfo; _rgTipText.Add(pszInfo); } } break; case bfSeparator: bi.L = …

Member Avatar
Member Avatar
+0 forum 1

Hello everyone! So I wrote a program that simulates a dice game, almost like the game of Craps. I want to turn this normal console app into a dialogue based MFC. So I would create a button labeled "Roll" and the window would show two die being rolled. Here is the code I have for the condole app. It works perfectly, but I am so confused as to how to assign the code to the button and also how to assign the die faces to its respective bitmaps. I appreciate the help! //Game of chance "Craps" #include "stdafx.h" using namespace …

Member Avatar
Member Avatar
+0 forum 1

For getting the share folder name i have been used the following code , here i am able to get the folder names . But the problem what i am facing is along with the share folder created by the user it gives some extra folder also , i don't know how to prevent the programe to hide that unnecessary folder names . Like in my case i am getting "cc_views"(used for clearcase) and "Users" folders , which i want to remove from my folder lists . I wrote the following codes , Please help in getting the correct output …

Member Avatar
Member Avatar
+0 forum 1

This is homework. I have been tasked with creating a new dialog in WinMerge that provides line stats for every open file. It should show total lines, lines modified and lines deleted. I am working on implementing the total lines part. I have already created the dialog, a class for the dialog and member variables for the controls on the dialog. I know how to update the data in the dialog as well. However, I cannot access the built in 'GetLineTotal' function. It is hidden in CGhostTextView, which CMergeEditView derives from. While it is implemented as a virtual function in …

Member Avatar
Member Avatar
+0 forum 1

so i created a client server program using tcp that works fine. but now i want to use broadcasting (which uses udp) so i'm changing to change my code but i keep running into problems. when i run my code the error message "ERROR binding: 10047" and that error means this: > Address family not supported by protocol family. > An address incompatible with the requested protocol was used. All sockets are created with an associated address family (that is, AF_INET for Internet Protocols) and a generic protocol type (that is, SOCK_STREAM). This error is returned if an incorrect protocol …

Member Avatar
Member Avatar
+0 forum 2

First off, this is a homework assignment. I am in a Software Engineering class and we're learning how to work with MFC. We're editing a basic calculator app. I don't know how to implement the backspace button (delete a single character from the edit box when the Backspace button is pressed). How is this done? I know that you can emulate character deletion with manipulation of char arrays in C++, but I don't know how you would do this with a number and in MFC. The application uses double integers.

Member Avatar
Member Avatar
+0 forum 3

Hello i'd like to ask a quick one. -Mfc VC++ 6 application. -NO Unicode support by design. -Greek characters appear fine in all dialogs since OS is Windows Greek version (?) -Greek text is both hard coded in c++ source files and retrieved from mysql database. -ONE specific Edit Box combines mysql data with greek text and hard coded in source files strings, to form a kind of report, and print it on paper. but: If i copy text from an Edit Box and paste it in notepad for example, the greek characters appear scrambled. If i print on paper …

Member Avatar
+0 forum 0

Hello everyone! I have a rather mysterious problem. I have a mfc dialog based application (running on win xp sp3), and at the same time another mfc app that installs a global keyboard hook capturing the ESC key (this one is always hidden). SOMETIMES when i press ESC key (with the dialog based application on top + focused) the dialog closes normally but it seems like it never returns the focus to the desktop (or any other window that is shown on screen). I realize that because the keyboard hook does not respond to the ESC press after that UNLESS …

Member Avatar
+0 forum 0

We might all imagine how many reams of paper HP must go through testing their printers before they hit the market, and how they must pass certain tests and get tweaked along the way. If you envision rooms full of printers and the smell of heated toner hitting the paper, you are not alone. At the Boise Idaho HP campus, there is so much more than I could ever have imagined. As the COO of DaniWeb, I was invited out to tour the campus and get a ‘behind-the-scenes’ look at HP’s printer testing campus in order to answer the question: …

Member Avatar
+0 forum 0

Hello everyone! I am building a mfc dialog based application in visual c++ 6 and using mysql c api to connect to a database. What i need is a simple type of data grid to show mysql query results in a dialog. I do not need to edit, update, save etc data from the dialog. Just show them on screen. I've checked libraries such as Ultimate Grid but they seem really complicated for my needs. I would prefer using built in mfc controls but don't really know if there are any suitable. Is there anything you could suggest as a …

Member Avatar
Member Avatar
+0 forum 6

Hi, I am using C++ MFC and I wouldn't exactly call myself an expert :-). What I have is a thread drawMonitor which monitors when to draw and I would like it to call DrawLines() (which is a member function in the class) to do the drawing. void drawMonitor(void *); //this is in the code file void drawMonitor(void *arg) { TCHAR buf[128]; _stprintf(buf, _T("Draw Monitor started\n")); OutputDebugString(buf); while (true) { if (g_VangleReady) { //DrawLines(); g_VangleReady = false; } else Sleep(g_DrawMonitorDelay); } _stprintf(buf, _T("Draw Monitor stopped\n")); OutputDebugString(buf); } void CDraw2::DrawLines() { //Code here } I am starting my thread using _beginthread(drawMonitor, …

Member Avatar
Member Avatar
+0 forum 1

Hi All, I am implementing a recursive registry delete using RegOpenKeyEx, RegDeleteKey and RegEnumKey. **Problem::** Though the code works perfectly fine for Vista x86/x64 and Win 7 x86/x64 but fails on XP for some keys in HKCR **Problem Area::** HKCR\Installer\SomeKey **Error Code::** 87 (INVALID_PARAMETER) **Weird Behaviour::** Deletes the key the moment I open the key using **REGEDIT**. **Code::** static BOOL K7RT_RcrsvRegDel( HKEY hKey, LPTSTR lpszSub ) { BOOL bRet = TRUE ; LONG lRet ; DWORD dwSize = MAX_PATH ; TCHAR szName[MAX_PATH] ; TCHAR szFullKey[MAX_PATH * 2] ; HKEY hKeySub = NULL ; HRESULT hr = NULL ; do{ lRet …

Member Avatar
Member Avatar
+0 forum 2

In my project I've 8 edit boxes and i need to set each box with different font. But my code is setting all the boxes single font.. So how can i modify it?? void CTrail3Dlg::OnBnClickedButton1() { UpdateData(TRUE); CFontDialog dlg; // get font for current dialog, just to fill in LOGFONT LOGFONT lf; CFont *pFont = GetFont(); pFont->GetLogFont(&lf); if (dlg.DoModal()== IDOK) { dlg.GetCurrentFont(&lf); m_font.DeleteObject(); m_font.CreateFontIndirect(&lf); GetDlgItem(IDC_EDIT1)->SetFont(&m_font); GetDlgItem(IDC_EDIT2)->SetFont(&m_font); GetDlgItem(IDC_EDIT3)->SetFont(&m_font); GetDlgItem(IDC_EDIT4)->SetFont(&m_font); GetDlgItem(IDC_EDIT5)->SetFont(&m_font); GetDlgItem(IDC_EDIT6)->SetFont(&m_font); GetDlgItem(IDC_EDIT7)->SetFont(&m_font); GetDlgItem(IDC_EDIT8)->SetFont(&m_font); } // TODO: Add your control notification handler code here }

Member Avatar
Member Avatar
+0 forum 1

Any pointers on how accented characters are implemented in Windows would be helpful. Goal - Ability to add accented characters(áéíóú) using keystrokes like ctrl + ' followed by a vowel and all other combinations that work on standard applications like MS Word, Text pad etc. My Findings till date - Everywhere I could read documentation/blogs/forums related to WM_DEADCHAR message.What I understand is : ::TranslateMessage translates WM_KEYUP messages corresponding to dead keys into WM_DEADCHAR messages, and it translates WM_SYSKEYUP messages generated by dead keys into WM_SYSDEADCHAR messages. Windows provides the logic that combines these messages with character messages to produce accented …

Member Avatar
+0 forum 0

hello everyone. i am at such a stage where i need to make a decision. i have gained enough basic programming skills withn c++ and now i want to start with something a little professional. i dont like web programming and i would love to do system programming or game programming. i need advice that which one of these technologies will be most fruitful (in terms of money :D )for me? should i stick to visual c++? or start with mfc? how about .net framework and c#? i aim to do freelancing stuff and am currently reading a mfc book …

Member Avatar
Member Avatar
+0 forum 10

hello :) i'm using MFC SDI, & i'm less familiar to it. i need to know, 1: i have found a way of printing a string as [CODE]pDC->DrawText( " Task still pending!!! ", &rect , DT_PATH_ELLIPSIS );[/CODE] but i want to know, how can i print a 2D-Array in MFC SDI? 2: i've included a Dialog Box aswell. but how can i access the variables of my "xyzView.cpp" file in the Dialog Box button fuctions? Thanks :)

Member Avatar
Member Avatar
+0 forum 5

hello :) i've Two questions to ask. i'm working on MFC SDI, i'm less familiar to MFC. i found that a way to print a string in MFC SDI is: [CODE]pDC->DrawText( " mc Test Ellipse ", &rect , DT_PATH_ELLIPSIS );[/CODE] but i have to print a 2D array in MFC SDI. so 1: how can i prind 2D array in MFS SDI? 2: i have included a Dialog Box aswell. how can i access a variable of my "xyzView.cpp" file in my Dialog Box Button's fuction? Thanks :)

Member Avatar
+0 forum 0

Hello :) i'm looking for a proper way of drawing points in MFC. or Drawing those point on a Drawn Eclipse. then i actually have to join them. i had been working on .NET, so i'm less fimiliar to visual C++ 6.0, but i have to use it for this. i can draw eclipse like: [CODE] . . . void CTesttView::OnDraw(CDC* pDC) { CTesttDoc* pDoc = GetDocument(); ASSERT_VALID(pDoc); pDC->Eclipse(100,100,500,500); } . . . [/CODE] but now, how can i draw points on it? since i have to join those points using lines later, how can i keep a track of …

Member Avatar
Member Avatar
+0 forum 4

Hi All, Why my QueueUserWorkItem is not at all working. My code is here: [CODE] typedef struct { PCHAR URL[MAX_URL] ; PCHAR DestinationPath ; }MAINDATA, *PMAINDATA ; int main(int argc, char * argv[]) { PMAINDATA pData ; BOOL bQuwi ; DWORD dwIndex ; PCHAR pURL ; pData = (PMAINDATA)malloc(sizeof(MAINDATA)) ; pData->DestinationPath = NULL ; pData->URL[0] = 0 ; do { if(argc < 3) { printf("Main Error-> Not Enough Arguments\n") ; break ; } printf("START\n") ; pData->DestinationPath = argv[2] ; while((pURL = (PCHAR)GetNext_FileList(pContext)) != NULL) { TempURL = StrDupA(pURL) ; pData->URL[dwIndex] = (PCHAR)TempURL ; dwIndex++ ; } dwTotalNumberOfURL = dwIndex ; …

Member Avatar
Member Avatar
+0 forum 1

Okay, I'm still a fresh out of college programmer (only been doing it for 4 years), so I will try to be as descriptive as possible. I apologize now for anything that doesn't make sense. I've got a C++ project that using MFC to create forms. I have my main window, and inside it I have 7 tabs, one of them called "Send". On this tab I have several buttons and other controls. One button, the "Add" button, in it's properties, I have set to be the default button (the button I assume fires off when you press Enter). Now, …

Member Avatar
Member Avatar
+0 forum 2

i have a code that uploads a file to ftp. i want it to add an exception in firewall when it executes so that the firewall doesnot request the user for permissions. i know how to add a registry entry but i dont know how to add a firewall exception using c++. i expect help here. thanks.

Member Avatar
Member Avatar
+0 forum 1

hello c++ dev team!!! i need lilibit help from you. like i write in my prevois thread i bulding now lab mangement, and tks to you i passt the SQL lavel, (tks lot)!!! so i'am stuck now in the view step, that meen when the seller well open the software he see the last selling in is lab, somthing like this. [url]http://i1-win.softpedia-static.com/screenshots/Software-Remove-Master_2.png[/url] but in my software the "key" is name of costmer, and the "value" is what he bought. first of all i can't find tool for this in the toolbox, and i dont know how to upload data to …

Member Avatar
+0 forum 0

Hey everyone, I'm new at visual c++ and MFC Applications, and so I am going through Ivor Horton's Beginning Visual C++ 2010 to make a drawing application through Microsoft Foundation Class. I added menu bars for options, such as shape(rectangle, line, and ellipse) and select colors (black, red, blue green). I have added message handlers to the program that makes it so that you can select different menu options like rectangle & blue, or ellipse & black. And I am at the point where the drawer can click LButtonDown to set the first point and the LButtonUp to release the …

Member Avatar
Member Avatar
+0 forum 2

Thanks in advance.. [B]I want to know how to get running process information of remote machine in vc++[/B]

Member Avatar
Member Avatar
+0 forum 1

Can anyone please give me a guideline on how to code the following? I have an MFC application which should call on a timer basis a python script from command line and read the ouput of that command line. I thought of using CreateProcess, but i have no clue of how am i going to read the output of the python script which is sent to the command line buffer. Is there any standard way of doing this? Thanks in advance.

Member Avatar
Member Avatar
+0 forum 2

The End.