getting active view of a mdi application

462 byte By resumurof at 2007-11-20 11:41:11
HI, i want to get an active view of a mdi application..CMainFrame *pFrame = (CMainFrame*)AfxGetApp()->m_pMainWnd;//CChildFrame *pChild = (CChildFrame*)pFrame->MDIGetActive();CChildFrame *pChild = (CChildFrame *) pFrame->GetActiveFrame();CmyView *pView = (Cm...

Cases & Accolades

680 byte By zvenny at 2007-11-20 11:41:12
For readability reasons, I tend to keep my code after a case between accolades. For code after multiple cases, I generally put the opening accolade after the last case ... int test=3;switch (test){case 1:{ AfxMessageBox("1"); break;}case 2:case 3:{ AfxMessageBox("2 or 3"); break;}}I now noticed th...

Suggestions Needed...

395 byte By usman999_1 at 2007-11-20 11:41:16
Hi All,I want to implement a GUI, where I have to split the Window in four different parts using a splitter. I am not sure, if I create four different views or just use a single window, and size the controls within every split ed region myself? Also, I am not sure if I user SDI or MDI?As always, you...

Address Searcher

301 byte By yoni1993 at 2007-11-20 11:41:18
Sorry if its not to the right section !I want to know how i can build a tool which can search a value from address.Starting 0x40000 to 0xfffffff.but how i can do thats ?with a loop ? 0x40000++ ?I know the readmemoryfunc.Thank you very much !...

How can we prepare PrepCache using Virtual list control

850 byte By Faheem_Arshad at 2007-11-20 11:41:20
Hi.I am using virtual list contro and my requirements is to load the items in chache on demand.OnChildNotify............NMLVCACHEHINT* pcachehint=NULL;if (message == WM_NOTIFY) { NMHDR* phdr = (NMHDR*)lParam; switch(phdr->code) { case LVN_ODCACHEHINT: pca...

Setting default values in FontDialog

141 byte By kranti at 2007-11-20 11:41:21
Hi,<br/> I need to set some specified face name,style,etc.. as default values on FontDialog before seleting other settings.how can i do it?

ClientRect of SDI

448 byte By usman999_1 at 2007-11-20 11:41:24
Hi all,I am working on a SDI application, there I am using a splitter to split the frame into two panes. Now, I want to adjust the pane size, for that I use GetClientRect within the Frame, the only problem is that that Rect returned also includes the size for the Toolbar above. Is there a way, that...

Need help with radio button ,for default selction

1145 byte By poshyradha at 2007-11-20 11:41:26
http://www.dev-archive.com/forum/showthread.php?t=437300I Have two radio button and i have enabled 'Group' Property for one of the radio button.When i launch the application the both the radio buttons remains unselected, I want one of the radio button to be selecetd by default when the app...

Splitter Window inside a View

584 byte By abhinav_805 at 2007-11-20 11:41:28
Hello All,I want to create a Splitter Window which can be placed at a specific location inside a View(e.g. derived from CScrollView) using the CRect valueThis Splitter Window will contain two panes :-Top Pane : Grid ControlBottom Pane : View derived from CScollView containing simple MFC controls lik...

how to create a win32 dll

782 byte By sina_izad at 2007-11-20 11:41:29
hii want to create an importable dll using visual c++. i want to be able to import this dll in C#. my problem is that in visual studio project wizard the only two project types that i see associated with win32 are 1- win32 console application and 2- win32 project and when i choose either and select...

random word generator function

808 byte By khenzel at 2007-11-20 11:41:37
i need a little help...What i'm trying to do is create a function that passes a random word selected from a list contained inside that function to a structure string contained in the globals.or more simply...struct Console{ // Identify structure for the game consolestring word; // the word to b...

Adress Type

58 byte By yoni1993 at 2007-11-20 11:41:42
How i can know if 0x123456 is a char/int/float or double ?

how do I debug a program that crashed...

1083 byte By the_learner at 2007-11-20 11:41:46
I ran my program from the command line and it crashed... and I got the following classic dialog box: "MyProg.exe has encountered a problem and needs to close. We are sorry for the inconvenience" And then there are three buttons:[DEBUG] [Send Error Report] [Dont Send] So, I clicked on Debug, hoping t...

population of an array of string...

677 byte By khenzel at 2007-11-20 11:41:48
Hi,i'm trying to figure out how to populte an array of strings...lets say i declare:string wordList[100];so now i have 100 strings populated on the string array wordList right?so if i did something like:wordList[100] = "one","two",..."onehundred";shouldnt that work?i have to ultimitely have it...

Statusbar text speed?

455 byte By Syslock at 2007-11-20 11:41:57
For a typical MFC app, how fast is setting text in the statusbar, e.g. SetPaneText() ?Say, I want to loop a million times:for(int i=0; i < 1000000; i++) { m_wndStatusBar.SetPaneText( 0, message );}How fast can setting text go?Obviously, the loop is faster without calling SetPaneText(), but I wa...

Problem passing a function string return to a structure string...

646 byte By khenzel at 2007-11-20 11:41:58
topic sais it all. how is this done?my function is returning a string...i figured i could do something like...struct.word = functionwithstringreturn();it runs and dumps with "an external component has thrown an exception"not even sure what that error means really...tried to get around it by imposin...

calling a defined function

629 byte By greenspacechunks at 2007-11-20 11:41:59
I have a function defined as follows in a header:void FindItem(NodeType* listData, char item, NodeType*& location, bool& found);When I try to call this function (which I have coded in an implementation file), I use the following:FindItem(listData,item,location,found);However, I get this error:...

Address searcher d

1276 byte By yoni1993 at 2007-11-20 11:42:02
i dont know why but i get wrong addys ny this code:UpdateData(1); unsigned long ulAddress = 0x79900; int test; int count=0; CString c; CString d; CString y; int t=0; while (ulAddress < 0x80000) { ReadInt(ulAddress, test); if (test == m_val) { count++; c.Format("%d", count); y.Format("%d...

simple char array access causes crash- why??

383 byte By azimuth_rising at 2007-11-20 11:42:03
This very simple function is crashing and I cant see why- every time I try to change the value of str[i] I get an access violation, and I don't understand why this is happening- anybody know?void ChangeToSpace (char* str){ size_t n = strlen(str) ; for (size_t i = 0; i < n; i++) {...

Multi Thread?

376 byte By yoni1993 at 2007-11-20 11:42:05
I saw many ways for make a multi thread soft (In MFC), but i dont so understand.Im searchig how i can launch a multi threaded function.void MT(){ int b; for(EVER) { b++; }}How to call it in another thread ?for then, my windows wont stuck while the function is working...

If you write this code you are the man

311 byte By powerstrokediesel at 2007-11-20 11:42:07
Write the program that fills in a 3 by 3 array with odd numbers. The display shows the arrays it is being filled. Use random integers to fill in the array from 1-10. Initialize the array to zero. Then find sum of matrix. Find the maximum number in the matrix and the number of times it occurred. You...

Unsigned long ?

114 byte By yoni1993 at 2007-11-20 11:42:09
UINT b = 0x0000e;<br/>b++;<br/>now b have to be = 0x0000f;<br/>but its doesnt.<br/>how to make it ?

Do My Homework

616 byte By powerstrokediesel at 2007-11-20 11:42:15
Write the program that fills in a 3 by 3 array with odd numbers. The display shows the arrays it is being filled. Use random integers to fill in the array from 1-10. Initialize the array to zero. Then find sum of matrix. Find the maximum number in the matrix and the number of times it occurred. You...

How to insert button in list control

182 byte By sulabh120881 at 2007-11-20 11:42:18
Hi to All<br/>I want to insert some button and other control in my list control.<br/>please tell me how can i do this.<br/>Expecting a favorable reply<br/>Thanks in advance

Scanning addresses

445 byte By yoni1993 at 2007-11-20 11:42:19
Finally with you help i finished my address scanner.Now, the scanner is very slow when im scanning 2,147,483,647 Addresses !Even if i make the scan in a separate thread its slowOrEven if i the scan in 10 threads its go slow.Someone have any way & Idea how to boost it ?Like "Cheat Engine" if someone...

Focus the View when we click it.

394 byte By veerakalai at 2007-11-20 11:42:20
Hai Friend, In my project i have more then one views, when i click the ICON the view is open one by one ... suppose my view is already open means, when i click the ICON it must be highlighted.... how i can do this reply me .......

getting a document pointer

243 byte By resumurof at 2007-11-20 11:42:23
how to get a current active document in an MDI application<br/>i tried this but im getting assertion<br/> CmyDoc* pDoc=(CmyDoc*)((CMainFrame*)AfxGetMainWnd())->MDIGetActive()->GetActiveView()->GetDocument();<br/>help me

Cursor help

59 byte By volkancin at 2007-11-20 11:42:32
How can i get the cursor when my dialog already activated.?

Viewing a C++ generated template code?

737 byte By USA_NAAL at 2007-11-20 11:42:33
Is there is any mean in which we can view the generated template of a given class using visual studio or any external tool or any other compiler (under Windows).for examplewe all know the vector templatetemplate<class _Ty, class _Ax>class vector : public _Vector_val<_Ty, _Ax>{...}then i...

strictly weak ordering of i,j,k coordinates

1602 byte By skydave at 2007-11-20 11:42:37
Hi,for my stdext::hash_map I have to implement a operator for strictly weakordering of my key_values which are are i,j,k coordinates which identify cells of a dynamic cell-grid.How can I order them? Ive tried it very hard but all attempts failed so far andgave bad results.Here is the codebase for th...

[C - Windows] Create a DOS gui

366 byte By Alhazred at 2007-11-20 11:42:40
I would give a better look to the software I'm writing, I want to be able to select an option by highlight it with arrow keys instead of write the correspondent number, something like what you can see in the pic below http://screenshots.xnavigation.net/viewimg/161/active/ntfs/reader/for/dos.jpgW...

How do I catch Ctrl+a key in PreTranslateMessage

292 byte By tropicchs2 at 2007-11-20 11:42:46
I want to process something when user hits Ctrl+a key in PreTranslateMessage.<br/>if (pMsg->message == WM_KEYDOWN && pMsg->wParam == ?)<br/> DoSomething();<br/>What is wParam for Ctrl+a key? There is no virtual key code for that.<br/>I don't want to do it in .rc file.

SQLSetConnectAttr failure

180 byte By aguess at 2007-11-20 11:42:47
hi<br/>i am working with access database and when i was debugging my application i got an error message <br/>Many tasks for the client<br/>Failure SQLSetConnectAttr of the driver

FTP Connecting

1483 byte By dellthinker at 2007-11-20 11:42:51
Hi all. I'm attempting to make a simple FTP client. For now i'm just trying to get it to connect the the remote server. Nothing else. Here is what i have so far:#include <iostream>#include <winsock.h>using namespace std;#define port 21int main(){ const int SIZE=100; char msg[SI...

ReadProcessMemory

159 byte By yoni1993 at 2007-11-20 11:42:55
I made a address scanner and i don't want him to scan read only memory.<br/>is it possible to make ReadProcessMemory read only the writeable memory ?

cast byte to int

338 byte By yoni1993 at 2007-11-20 11:42:59
im trying to type cast from byte to int but i get a wrog result. BYTE test[2] = {0x0A, 0x00}; short b = (short)test; CString g; g.Format("%d", b); MessageBox("Number: "+g);0x0A, 0x00 should be 10 as int. and i get -100138.beside, the result dont change even if i change the bytes !...

Command Line Argument-error

538 byte By sudeephooli at 2007-11-20 11:43:04
Hi All,In my SDI application works fine before giving commandline arugments.If i give command line argument my application not running. It gives the message like thisd:\stgcal\10 was not found10 is a command line arguments which I passed.If i Debug the program it throws the error in InitInstance if...

CopyFileEx doesnt work

556 byte By Dan Epst at 2007-11-20 11:43:09
I need to run one thread, which copies files to other location (the files can be quite big) and another one, which watches over the first thread and kills it after some timeout.I don't want to create the state, when the copying thread is killed before completing it's work. So if the coping...

What is wrong? [CListCtrl] help:

1643 byte By Hakan Bulut at 2007-11-20 11:43:11
SetListView(LVS_REPORT); LV_COLUMN lsCol; LV_ITEM lsIte; lsCol.mask = LVCF_FMT|LVCF_WIDTH|LVCF_TEXT|LVCF_SUBITEM; lsCol.fmt = LVCFMT_LEFT; lsCol.cx = 40; char* arColumns[7] = {"Date","I.","II.","III.","IV.","V.","VI."}; char* arCols[7] = {"s1","s2","s3","s4","s5","s6"}; CString s1, s2, s3, s4, s5,...

Create new main-frame with CreateNewFrame()

1465 byte By a-jage at 2007-11-20 11:43:15
Hello.I have a Multi-Top-Level-Documents based application.After a button click, the application should create a new main frame based on a new doc-template.The message handler:void CDesktopChatMessengerView::OnClicked(){ theApp.NewFrame(); }The function:void CDesktopChatMessengerApp::NewFrame(){ CMu...

Create new main-frame with CreateNewFrame()

1465 byte By a-jage at 2007-11-20 11:43:16
Hello.I have a Multi-Top-Level-Documents based application.After a button click, the application should create a new main frame based on a new doc-template.The message handler:void CDesktopChatMessengerView::OnClicked(){ theApp.NewFrame(); }The function:void CDesktopChatMessengerApp::NewFrame(){ CMu...

Reading ASCII files

2774 byte By jayram at 2007-11-20 11:43:18
Hello,I have the following code (modified from a post) that compiles fine. however, no data is read on execution and no print out is sent to the screen. I am not sure if teh file i have specified is even being recognised and read.can anyone spot where i have gone wrong here - been on it for ages (ju...

InitializeCriticalSectionAndSpinCount

1041 byte By mysterd429 at 2007-11-20 11:43:23
Hi, all,I'm new to Windows programming, though I've been doing C/C++ for about 8 years. I'm trying to use a CRITICAL_SECTION without any luck. I was trying to follow the example at http://msdn2.microsoft.com/en-us/library/ms683476.aspxI'm just trying to understand how the funct...

Rich Edit makes dialog close

497 byte By Dave C at 2007-11-20 11:43:24
Try this please: Create a simple dialog based MFC application with the default OK and CANCEL buttons. Add a Rich Edit control to it. Build the application and run it in debug (F5). The dialog terminates instantly.Remove the rich edit control, rebuild, and the dialog will pop up normally.I can't...

High Low program syntax errors

1224 byte By SichoticDmen at 2007-11-20 11:43:32
main.cpp#include <iostream>#include <cmath>#include "Highlow.h"using namespace std;int main(){ Highlow generate; generate.UserInput(); system("pause");}------------Highlow.cpp#include <iostream>#include <cmath>#include "Highlow.h"using namespace std;void Highlow::UserInput(){...

Some code problems

473 byte By nicauf at 2007-11-20 11:43:33
I'm working on this program and I need some help with it. One thing I can't get to work is my looping. The program should loop until the user types 'xxx' for the first name. Well after I get done inputing the first "person's" info it errors when its time to put the next pers...

CCryptProv failed to initialize

554 byte By madric at 2007-11-20 11:43:47
Hi everybody,I am trying to use the cryptographic api in my mfc program.But when I simply use the following lines:CCryptProv u_Prov;HRESULT hr = mu_Prov.Initialize(PROV_RSA_FULL, NULL, MS_STRONG_PROV);the return value is an error ("Keyset does not exist")It is working on my other computer (xp pro) b...

How to insert data into ListBox(Something Different)

1596 byte By ashishbhatt12 at 2007-11-20 11:43:51
Hi All,I am using Win32 Application. In that I have created resource as Dialog and also in this Dialog I have added onr ListBox control. Now I want to insert data in to this Dialog.In this I have added one C++ class in which I am using like below to open Dialog....void CCurrentWnd::Open(){ DialogBox...

game board(Urgent,tommorow must be submitted)

271 byte By kaneqeqeq at 2007-11-20 11:43:52
If we enter "FOX",the compter can locate the position of this word,how can I do this ? could anyone give me a solution ? (even a general concept is ok)<br/>(But only Array can be applied as the pofessor ordered) thanks so much !!^^<br/>eg:<br/>GAOF<br/>ODJO<br/>KRYX

CView derived from CListview

171 byte By resumurof at 2007-11-20 11:43:54
HI,<br/> I want to create a list of images(of some default path) as a thumbnail in view window in my MDI application does anyone knows few samples kindly let me know..