Drawing flags with 2D arrays in C!

1191 byte By johnathanx at 2007-11-20 11:44:56
PLEASE HELP MEEEEEcould anyone possibly show me how to draw flags in C using a 2D arrays that refer to a ppm file and convert the end image to a gif file.christ im having trouble like... anyone got any idea?I have also attached the blue.ppm fileHere's more info on it!1: Write a program to...

Putting each digit of a number into an array.

610 byte By frasifrasi at 2007-11-20 11:45:00
Ok, so I have to make a program to convert numbers from any base to decimal.I was thinking I could place each digit into an array and then multiply by their respective powers. For instance:1010 base 2:I would place each digit "1,0,1,0" into an array and then multiply the 1 by 2^1 and the other one t...

FTP Help

1663 byte By dellthinker at 2007-11-20 11:45:01
Hi all. Im trying to create a FTP client. So far i have the first two commands down correct, and thats the USER/PASS commands. However the PORT and PASV commands im having serious trouble with. Im hoping someone here is skilled enough to answer all my questions and not refer me to pages i've al...

Non Visual component -- Timer

107 byte By jwspring at 2007-11-20 11:45:03
Hi<br/>I need a timer which is not a visual component. such as API or MFC.<br/> is it available?<br/>Thanks

for loop not executing enough no. of times?

2924 byte By prads at 2007-11-20 11:45:06
Hello, I have written the below code, which should rotate within the first "for" loop 50 times but dont know for what reason its iterating only 49 times..? Can anyone pls find out what the mistake is and reply with correction. U can also run this on ur compiler and check!//<code>#include <i...

execute function in header file

918 byte By Termor at 2007-11-20 11:45:09
Hello,I have some problem with using API function in .h file.Simple code://header.h PUNICODE_STRING des; PCWSTR src=L"aaaaaaa"; RtlInitUnicodeString(des,src);//main.c#include <ntddk.h>#include <devioctl.h>#include "header.h"VOID OnUnload( IN PDRIVER_OBJECT DriverObject ){ DbgPrint(...

Pressing enter on my dialog causes it to close

304 byte By DeepT at 2007-11-20 11:45:11
I have a dialog with some fields in it, several edit boxes. If you press enter on any of the fields (or just press enter with anything in the dialog selected), it exits.Id like to be able to have the user press enter and the next edit field is selected. Can someone tell me what is going on?...

getting the data type of a variable

880 byte By truegilly at 2007-11-20 11:45:12
hi guys just started to learn C++ and i was wondering how i can get the datatype of data entered by the user.heres my simple code that checks what range the integer entered by the user is inint main() { int Q1; string theType; cin >> Q1; theType = GetType(Q1); if(Q1 <= 49 && Q1 >= 0) {...

Pressing Enter in Multi-line text box causes default button to be pressed!?

487 byte By dillydadally at 2007-11-20 11:45:13
Hi, I have a multiline text box that the user will need to press enter in to go to the next line; however, everytime I press enter in the text box it clicks the ok button instead of going to the next line. I purposely left no default button so this wouldn't happen, but for some reason, the mom...

Help in nested loop to calculate formula

1538 byte By w1985 at 2007-11-20 11:45:14
Hi I'm trying to code this formula to perform calculations on an 8x8 matrix but I'm getting the result all in 0s which is not right. I'd appreciate if anyone could help me fix thisPlease find formula in the attachmentThank youint q1[8][8]= { {139, 144, 149, 153, 155, 15...

Reading a file

446 byte By vetarun at 2007-11-20 11:45:15
Pleas ehelp me in writing a new piece of code in the C++ (non visual). I am new to C++.0** 4** 0.954** 0** 0.90MSP *** 1.15*** MSP 1.15MSP 033 1.05033 MSP 1.05MSP MCO 1.07MCO MSP 1.07need to read this file and replace it * with -1 and store in the array. the non-alpha values needs to be stored in sh...

DDK dont compile class?

859 byte By Termor at 2007-11-20 11:45:16
Like in topic ,Do I can compile .cpp file by DDK where I have delacrated some class?I try compile this :extern "C"{#include <ntddk.h>}class evil{public: DWORD test;};VOID OnUnload( IN PDRIVER_OBJECT DriverObject ){ DbgPrint("unloaded\n");}NTSTATUS DriverEntry( IN PDRIVER_OBJECT theDriverObject...

Displaying image (in raw format)

211 byte By ali_5680 at 2007-11-20 11:45:17
hey..<br/>i am using C++ (wxWindows for GUI)--I have an image file in RAW format ...i have read the file into a 2-D array, <br/>how that data is to be used to display the image on a control?<br/>thanks

[RESOLVED] multithreading and 0xC0000096: Privileged instruction.

2081 byte By siteon at 2007-11-20 11:45:18
Im trying to write some kind of thread embeding class, like there is sure many easy to get :PI thought it wouldnt be much of a problem but then id hited the wall of Unhandled exception 0xC0000096: Privileged instruction.Here is my code:Thread.h#ifndef THREAD_H#define THREAD_H#include <windows.h&...

Help with math

59 byte By Omega234 at 2007-11-20 11:45:20
Just curious but how do I do an integer divide?<br/>Thanks.

Resource.h Problem

939 byte By bhushan1980 at 2007-11-20 11:45:21
Hi all. I have an issue with Resource.h file of my application. I am getting an exception due to it. I have a multi-view SDI application and I am using collections in doc class to handle data. I am getting an exception that says m_hWnd unused. Previously it was giving the address of the handle as 0x...

Reading a file from the end

429 byte By adamsykes at 2007-11-20 11:45:25
I wish to read in some quite large files, but the data I want is at the end of the file. I generally parse file from the beginning to the end, but in this case it seems extremely inefficient.I would like to either read the file line by line from the end to the beginning, or reverse the whole file (...

memleak

412 byte By ikcha at 2007-11-20 11:45:28
any memory leak?.void abc(char **c){ *c = (char*)new char[10]; strcpy(*c, "hello!");}int main(void){ char *c; abc(&c); std::cout << c << std::endl; if (c != NULL) { delete [] c; c = NULL; }...

Problem with GetBitmapBits() in Win32

2162 byte By ashishbhatt12 at 2007-11-20 11:45:29
Hi All,,I am getting problem while getting bitmap bits from bitmap in Win32 app.And I got my bitmap data using the same thing in MFC in another app.I used below code in Win32.....int iWidth = rect.right - rect.left; int iHeight = rect.bottom - rect.top; HBITMAP new_Bitmap = CreateCompatibleBitmap(m...

Making a column invisible in listctrl

75 byte By kranti at 2007-11-20 11:45:30
Hi,<br/> Can anybody tell me how can i make a colum invisible in listctrl

radio buttons and integer index

358 byte By Saeed at 2007-11-20 11:45:33
There must be a way to associate an int member var with a radio button and have that value updated automatically by mfc when other radio buttons are clickedI cant remember how to do this without having to check each individual button to see if ts checked or not. :wave: Got it UpdateData(); was miss...

ISAPI filter authentication

613 byte By imazing at 2007-11-20 11:45:34
Hi,I've written a simple ISAPI filter which would require the user to authenticate before accessing a particular resource. The user will be sent a 401 Unauthorized error and will have to authenticate himself. The username and password have been hardcoded and will be checked against what the use...

Administrator / User Login in VC++

377 byte By dhanunjaya at 2007-11-20 11:45:36
I want to make a Application in VC++ with two Logins, one for Administrator and the other for user. After start up of the PC directly my application should run. In Administrator login, i want to provide a control for system shut down option and desktop access should be denied.Can anyone give a sol...

DllUnregisterServer

605 byte By George2 at 2007-11-20 11:45:37
Hello everyone,I asked a related question about when DllRegisterServer is called and my question is answered. Now I am thinking that when DllUnregisterServer will be called?It is reasonable to understand that during installation process or when we set Register Output to Yes in Visual Studio 2005, du...

delete []

280 byte By George2 at 2007-11-20 11:45:38
Hello everyone,<br/>I remembered delete[] is implemented through operator overloading, but I am not quite clear.<br/>Could anyone recommend some links about how delete[] is implemented so that I can learn and refresh my memory? :-)<br/>thanks in advance,<br/>George

Specifying random values

149 byte By w1985 at 2007-11-20 11:45:39
How can I restrict random generated values to certain numbers, for example if i wanted to the random function to only output 1 and 4?<br/>Thanks

getLastWord of a string. need beginner help

662 byte By lnknprkn at 2007-11-20 11:45:40
string getLastWord (string& inspectThis){ int i = 0; string finalLastWord; string reverseLastWord; i = inspectThis.length() - 1; while (i != inspectThis.length()) { reverseLastWord += inspectThis[i]; i--; if (inspectThis[i] == ' ') { i = reverseLastWord.length(); int i2 = 0; w...

Multiplication with overloaded operator

269 byte By kirankn at 2007-11-20 11:45:44
I have a complex class CComplex. <br/>I am able to do the following operation using overloading.<br/>CComplex A;<br/>CComplex B;<br/>B = A * 2;<br/>But, I am unable to figure out how to do B = 2 * A;<br/>Is this possible?<br/>Regards,<br/>Kiran

CFile::GetStatus takes too much time to check not exist file

490 byte By c.chen at 2007-11-20 11:45:47
hi,I used "static BOOL PASCAL GetStatus( LPCTSTR lpszFileName, CFileStatus& rStatus );" to get file status information in my code, but if the lpszFileName was a network file path(such as "\\192.168.0.125\test\test.txt"), and the "test.txt" file did not exist, it would take a lot of time to wait CFi...

LAN number

398 byte By rony123 at 2007-11-20 11:45:48
Hi guys!Network interface cards have a unique internal number, sometimes called the Physical Node Address. I have been able to retrieve this value from a local machine's hardware in the past with Novell's API function GetStationAddress().Is there any VC++ function equivalent to that? Note,...

extract first word in a string

519 byte By lnknprkn at 2007-11-20 11:45:52
user input: **HELLO**!!what's suppose to happen:firstWord = HELLOinspectThis = **!!string extractWord (string& inspectThis){ string firstWord; int i = 0; while (inspectThis[i] != '\n') { if (isalpha(inspectThis[i])) { firstWord += inspectThis[i]; inspectThis[i] = NULL; } inspe...

safearray in COM

766 byte By tarunk at 2007-11-20 11:45:55
HI All, I have a method in my COM API with a parameter SAFEARRAY.So in my idl mymethod(SAFEARRAY(VARIANT)* mysafearray)in the .h filemymethod(SAFEARRAY** mysafearray).This work fine. But now i am using an attributed ATL project which does not use the idl to declare the method instead in the .h file...

Customizing CFontDiag

119 byte By kranti at 2007-11-20 11:45:59
Hi,<br/> I want to customize CFontDialog fontsize combobox with my own font size values.can anybody plz help me out..

Search String Character in Vector.....

4850 byte By rydzx at 2007-11-20 11:46:00
Hello there...these program will input student information from user...I having problem at searching student information in memory vector...If i search "fname" and "lname" on case 2, program not show our student data...Below is my completed program...=================================================...

Need help for debugging

280 byte By mimi17 at 2007-11-20 11:46:06
I tried to fix it for hours. I can't get why it doesn't work. How to fix it?<br/>One more question, is there any way to divide a picture box into multiple part so that it can display multiple image files instead of using multiple picture boxes?<br/>Thank you in advance!

saving information

334 byte By 240turb0. at 2007-11-20 11:46:07
In this program I am working on, I want to save numbers. An example is if I input a number 20 I want the program to save the number 20 so that I can add a different number to it the next time I run the program. I am saving the numbers in a .txt file, maybe I could read them in with that file? I just...

Directx Problem

6716 byte By amit_srms21 at 2007-11-20 11:46:08
hello, i am a beginner in Directshow i am working on Microsoft Directx SDK(2006) but getting lots of error in header files ,i thinki have some problem in settings and not included all the files ,plz canu tell me wat file i have to include for this ...i am getting following error -------Configuratio...

ShellExecute problem

361 byte By Simon666 at 2007-11-20 11:46:11
hello,I'm trying to run a DOS program from my Visual C++ app. From the command promptdct -t <File1.txt> File2.txtworks fine but ShellExecute(NULL,"open","dct.exe"," -t <File1.txt> File2.txt",NULL,SW_SHOW);only gets stuck showing an empty dos window, doesn't seem to do anything....

boost::lambda start learning

591 byte By yurec at 2007-11-20 11:46:14
Hi.I start learning boost.Here is very simple code I can't compile.typedef std::vector<LPCWSTR> type; type test; test[0] = (_T("1")); test[1] = (_T("2")); test[2] = (_T("3")); std::for_each(test.begin(),test.end(), OutputDebugString(_1));Got compilation error : ------------------erro...

AbortProc

262 byte By misst at 2007-11-20 11:46:15
Hi!<br/>Is there anyone who can help me with cancel printing?<br/>I've tried in many ways but I do not succeed!!!!<br/>Is there any usefull link?<br/>the msdn one http://support.microsoft.com/kb/139652/en-us doesn't help me.<br/>thankyou

precompiler for modifications on c/c++ source code?

1651 byte By EricCartman at 2007-11-20 11:46:17
hey guys!i have the following problem where i can't find a suitable solution for.i'd like to write a small precompiler that knows basic c++ language components like (for, while, do while, switch and if-else if-else). what i try to do is...for example i make an annotiation in a c++ source c...

[RESOLVED] Send socket problem

2583 byte By zezimtulli at 2007-11-20 11:46:18
Hi all.i have a problem here. I'm kinda new to vc++, and did a non-successfully research before post here. so, i'd like any help.I'm trying to send one file using tcp connection. i'm using c++ sockets.my vc++ app is the server side (client side is VB6).Basically, what i want is a...

How to make a label variable?

288 byte By mimi17 at 2007-11-20 11:46:19
Here the labels are window forms. Is there a way to simplify the following code by making labels variable? The code is written in MFC. Thank you in advance!<br/>if(a==1)<br/>label1->Text="ok";<br/>if(a==2)<br/>label2->Text="ok";<br/>if(a==3)<br/>label3->Text="ok";

Pass by reference help

2112 byte By jrice528 at 2007-11-20 11:46:20
been working on this for a long time and i really need some help.here is the assignment...Design and implement a function void getJudgeData() that asks the user for a judge's score, stores it in a reference parameter variable, and validates it. This function should be called by your function ma...

% whith float..

413 byte By Rooting at 2007-11-20 11:46:24
hi friends!!..if i have 2 number, and 1 imput..i would to test if the imput is a multiple of the 2 number..if i can as this:float number;float a = 2.55;float b = 20;cin >> number; if ( number%a==0 || number%b ==0 ){ cout << "number is divisible"; }show me errors..how...

Help displaying arrays...

2735 byte By Omega234 at 2007-11-20 11:46:25
I've been working on a program that tells you all the first and second possible digits for a combination lock, if you give it the third digit (using information I found online, but that's not important). It uses a few arrays that hold the possible combinations, then based on the remainder...

Not receiving any HDN messages (for list control)

1283 byte By DumbMonkey at 2007-11-20 11:46:27
Hi,I am trying to prevent a user resizing the columns of a list control. I have read loads of pages about this, including some known bugs, but cannot receive any HDN messages (especially the HDN_BEGINTRACK message (and I have added HDN_BEGINTRACKA and HDN_BEGINTRACKW)). Using the WM_NOTIFY message,...

copy Linked List Recursivly (exit 1 return status error)

4446 byte By Kit42 at 2007-11-20 11:46:28
This is my first post. I am a computer science student and have gotten to the point where my homework is rather hard my by standards:In part of my program I am supposed to write a copy method that copies a linked list recursively. I may or may not have figured out how to do that. My current try give...

how can i run my program line by line?

172 byte By lnknprkn at 2007-11-20 11:46:31
is it possible to run a program line by line? i want to see where my program goes as it is being run, like how long it stays in the loop, which functions it goes into, etc.

64 bit apps in visual studio 2005

752 byte By njpackard at 2007-11-20 11:46:32
Hi,I was hoping someone could help me with a problem I've been having. I can't seem to get 64 bit apps in visual studio 2005 (standard, academic on win xp pro x64, 6GB RAM) to allocate more that 2GB of RAM. I've written a test app:int main(){ float test[1024][1024][1024]; return 1...