[C] A hard-to-implement Algorithm

1072 byte By mfonz85 at 2007-11-20 11:41:53
Hi all, a friend of mine recently explained to me a problem he hasn't solved yet, I'll try to explain it briefly so you can think a minute or two about it...It has to be resolved with a standard C command line program, the old fashion way...(1) We have a 16 elements array.(2) We have a num...

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:...

Pixel Perfect -

298 byte By .pcbrainbuster at 2007-11-20 11:42:01
Sup people,<br/>How do programmers get their programs to position everything so perfectly? For example a program may just consist of some text and a edit box and the programmer postions them both half way from the top and left with 10 pixels difference between the two things.<br/>Thanks.

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...

Need help.

995 byte By k0b381 at 2007-11-20 11:42:06
Have the user enter a character. Tell them if the character is a number, a lower case letter, an upper case letter or neither a letter nor a number. i cannot figure out how to make it so the program knows its neither a letter nor a number , this is my code so far#include <iostream.h>int main()...

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 ?

C++ String manipulation, input file.

2642 byte By JoBlo69 at 2007-11-20 11:42:13
Hello,I am in the middle of writing a C++ app in which the user has to input a file path, and the app "echo's" the contents of the .txt file into the cmd window...This is the layout of the .txt file.Fresno Ca 2.69Oakland Ca 2.69Corvallis Or 2.89Vancouver Wa...

encrypt string on socket?

2236 byte By Kensino at 2007-11-20 11:42:14
I am using C# not C++ but I am having a hard time getting a working solution, so I wanted to ask in this networking forum. I have tried to use several classes like sslstream, but they are really advanced and also require the user have admin permissions on the client. Basically, my question is. Is 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...

Tcp/ip Non Blocking Socket In Linux

438 byte By nilamlalaji at 2007-11-20 11:42:17
hello all,I m facing a problem in tcp/ip non bloking socket.Receiver can not get the data same send by sender....but some random data comes along with original one.....Can anyone send me a complete program where sender can send large data in a for loop and receiver receive exactly same data send by...

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

filesystem

1040 byte By staticVoid at 2007-11-20 11:42:25
having a problem with checking to see if a directory exists:#include <iostream>#include <dirent.h>#include <sys/stat.h>using namespace std;bool isdir(const char * filename) { struct stat *buffer; stat(filename, buffer); if(S_ISDIR(buffer->st_mode) == 1) { return true;...

char* to string^ conversion

1754 byte By nirVaan at 2007-11-20 11:42:29
hii have linked list in which the node holds a char* to represent a string linked list is done using native code but for me to display it in a text box i have to make it a String^ but the problem is im able to insert the string value to this char* using the following codingIntPtr p = Marshal::Strin...

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...

Limit to control Entries

247 byte By Pravish at 2007-11-20 11:42:38
hi,<br/>I hv a dialog here that has over 100 static and edit control boxes.. I m not able to insert anymore edit control boxes.. if i hv to then i hv to delete some... is there any upperlimit to no. of control entries we can put in a dialog??

[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...

Skipping non-integer values

501 byte By frasifrasi at 2007-11-20 11:42:41
Say I have a list of numbers and that my program is only supposed to deal with integer values... Does anyone know a simple way to determine if one of the values is a decimal (like 5.6) , output a message and skip it?I already know a way to locate letter and output an error message, but the if statem...

Invert Pixels

334 byte By greeneggsandham at 2007-11-20 11:42:42
How can you invert all the pixels on the screen, not just once but continuously? One of the problems you run into with this is that the second time you want to invert it goes back to regular. A example that works is with windows magnifier, to try press Win + r then type in magnify. Then on settings...

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

Dialog Background Color

491 byte By goobers at 2007-11-20 11:42:48
Hi, I have a question on how to color the background of a dialog multiple colors. Generally, for a single color throughout, I would create a solid brush with the color I desire, then use WM_CTLCOLORDLG to pain the background. What I am trying to do however, is have multple colors, a section of purpl...

help with bi-directional association

1267 byte By idwilson at 2007-11-20 11:42:49
Hi,I have some Java code that I am trying to convert to C++, but I am stuck.I have a class called Person that has an association with a class called Address, and the Address is associated with a Person.So, the skeleton I have looks like:class Person{friend class Address;private: string name; Address...

[RESOLVED] How to assign a bitmap to a menu item?

1721 byte By gcsaba2 at 2007-11-20 11:42:50
I know that I'm supposed to use the SetMenuItemBitmaps() function, however in this specific case this doesn't work.I've created a COM object which adds a new menu item to the Windows popup menu when you right-click on any file. This works well and the menu is added. However, I want th...

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 ?

About This program

246 byte By dragoon112 at 2007-11-20 11:42:56
Hello, i bought a program from a guy that i know. i bought program and source. it is a zlib .RFP and .RFI unpacker. it unpacks to a folder. but i wanted to know if someone can reverse the script to make the folder pack into an RFI and RFP. Thanks

Open/Save/Folder Dialogue -

126 byte By .pcbrainbuster at 2007-11-20 11:42:57
Sup dudes,<br/>Isn't there any default for those dialogues? Its anoyying to type down all the info.<br/>Thanks.

Question on CIN

679 byte By Flakester at 2007-11-20 11:42:58
Hey guess, sorry for the rookie questions. I'm new to this, I tried a search and really dont even know what I'm looking for, or what this would be called.I'm trying to make a numerology report, but I'm not looking for complete help.I just have a simple question reguarding my cin...

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 !...

Communication between two programs?

437 byte By pirateninja at 2007-11-20 11:43:03
I need to communicate between two programs. One of the programs is in C++, however the other is in VB6. I need to pass the address of the hDC of a form in the VB6 program to my C++ program. I thought to save the address of the hDC to a file and read it in C++ but I don't know how to turn "-1409...

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...

partially AI program

894 byte By nerdykid at 2007-11-20 11:43:06
im trying to make a program that has an awkward for of artificial intelligence. its actually quite a pointless program, but it will help me introduce myself to another aspect of programming. in this program, the user enters any input, such as a command, and it iterates through a file. while iteratin...

is there something Im missing?

939 byte By mase at 2007-11-20 11:43:07
I can not seem to get this to work in WinAPI because the error saying that my class member function is not defined even though I declare inside my class in the header file.I have three files: project.h, project.cpp, projectMain.cppproject.h where I create my class, member function and data. In memb...

32/64 bit compatibility issue

289 byte By _uj at 2007-11-20 11:43:08
There's a 32 bit as well as a 64 bit version of Windows Vista. <br/>Say a program is compiled to the Intel 64 architecture instruction set. Will it run on a 32 bit Vista?<br/>Say a program is compiled to the IA-32 architecture instruction set. Will it run on a 64 bit Vista?

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,...

Inverting regions -

117 byte By .pcbrainbuster at 2007-11-20 11:43:13
Sup guys,<br/>How would you let a user select a region(create it) and then invert the contents?<br/>Thanks.

Borland C++ 5 to 6 template code migration

614 byte By Kotfeller at 2007-11-20 11:43:14
Hi,I developped a code of mine in Borland C++ 5, as I tried to compile it in Borland C++ 6, a strange error code appear:The code is based on template:template <class Foo>class TExample : public Foo::arg{};During the first compilation phase (before any instanciation), the Borland C++ 6 compil...

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...