|
hi,
NOP, the same message. I copied rc.exe and rcdll.dll from visual stidio 6 to platform sdk/bin. It works ok, but i know it is not right.
Any thoughts ?
regards
hari
Hari Krishnan
|
|
|
|
|
pranavamhari wrote:
what could be wrong with the resource compiler?
MS purposely crippled it so it will not run on 9x/Me. If you have access to older Platform SDK CDs, go back to around Oct 2001 or so and grab the RC.exe from there.
--Mike--
Ericahist | CP SearchBar v2.0.2 | Homepage | 1ClickPicGrabber New v2.0! | RightClick-Encrypt
"That probably would've sounded more commanding if I wasn't wearing my yummy sushi pajamas."
-- Buffy
|
|
|
|
|
Hi,
How can I read raws and columns of a .csv file?
I would like to move from one column to the next,, how can I do that ?
Ehsan Behboudi
|
|
|
|
|
The raws (rows) of the file can easily be read with CStdioFile::ReadString() . The columns can be handled with AfxExtractSubstring() , or CString::Find() . There's more than one way to skin a cat, however.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
how do I use those commands in my code
right now this is how I read my .csv file
ifstream infile(file1);
char temp[500];
infile>>temp;
// so now i want to move to the next row or column, how do I do that with your syntax?
Thanks
Ehsan Behboudi
|
|
|
|
|
Very seldom do I use streams so this might not work, although it should get you close:
istream in;
while (in.eof() == 0)
{
is.getline(temp, sizeof(temp));
}
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Can anyone tell me why this program is not working? I wrote this program the other day and I keep getting error messages.
Here is the program:
/*
XOR.cpp
Brandon Quick
brandon@omlit.om.org
Proper usage is XOR.exe filename Key
Encrypt the file with a key 324
XOR.exe plain.txt 324
Decrypt that file
XOR.exe plain.enc 324
Encrypt a file
XOR.exe keepsafe.txt 56765
Decrypt that file
XOR.exe keepsafe.end 56765
*/
#include <iostream.h>
#include <string.h>
#include <stdio.h>
float atol;
int XOR(char * filename, unsigned long key);
int main(int argv, char ** argc)
{
unsigned long key;
char filename[100];
//if they used command line arguments pass the filename and key to xor function
if( argv == 3)
{
if( XOR(argc[1],(unsigned int)atol(argc[2]) ) )
{
cout << "There was an error trying to encrypt/decrypt the file " << argc[1] << endl;
}
}
//other wise prompt for the key and filename
else
{
cout << "What is the filename?" << endl;
cin.getline(filename,99,'\n');
cout << "What is the key?" << endl;
cin >> key;
//tell the user about command line then call xor function
cout << "Next time you can use the command line, the format is " << argc[0] << " filename key" << endl;
if( XOR(filename,key) )
{
cout << "There was an error trying encrypt/decrpyt the file " << filename << endl;
}
}
return 0;
}
int XOR(char * filename, unsigned long key)
{
FILE * input = NULL , *output = NULL;
char * outfilename = NULL;
int len = strlen(filename);
unsigned char buffer;
if( (filename[len-4] == '.') && (filename[len-3] == 'e') && (filename[len-2] == 'n') && (filename[len-1] == 'c') )
{
// our input file is encoded then we will create a file without the .end extension
outfilename = new char[len+1]; //make room for the name+\0
strcpy(outfilename,filename); //copy the string name
outfilename[len-4] = '\0'; //put the \0 before the .enc extension to cut it off
}
else
{
outfilename = new char[len+5]; //make room for the name + .enc + \0
strcpy(outfilename,filename); //copy the file name
strncat(outfilename,".enc",4); //add the .enc extension
}
input = fopen(filename,"rb");
if( input == NULL)
{
cout << "Error opening file " << filename << endl;
delete [] outfilename; //free the memory before leaving
outfilename = NULL;
return 1;
}
output = fopen(outfilename,"wb");
if( output == NULL )
{
cout << "Error creating output file " << outfilename << endl;
delete [] outfilename; //free the mem before leaving
outfilename = NULL;
return 1;
}
while( ! feof(input) )
{
//get some data
if( fread(&buffer,sizeof(unsigned char),1,input) != 1 )
{
//if we didnt get any data, but we are not at the eof, then an error has occured
if( ! feof(input) )
{
delete [] outfilename;
outfilename = NULL;
fclose(input);
fclose(output);
return 1;
}
}
else
{
//xor that data
buffer ^= key;
//write some data
fwrite(&buffer,sizeof(unsigned char),1,output);
}
}
//close the files and free that memory
fclose(input);
fclose(output);
delete [] outfilename;
return 0;
}
|
|
|
|
|
HackerBoy wrote:
Can anyone tell me why this program is not working?
Define "not working."
HackerBoy wrote:
I wrote this program the other day and I keep getting error messages.
What are those error messages?
Some things that struck me as odd:
float atol;Not sure what you are trying to accomplish here.
int main(int argv, char ** argc)Traditionally, argc is the number of arguments, while argv is the argument vector.
if( XOR(argc[1],(unsigned int)atol(argc[2]) ) )
int XOR(char * filename, unsigned long key)In the call to XOR() , the second argument is being cast to an unsigned int , while the function's prototype is expecting an unsigned long .
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
How can I use the AlphaBlend()GDI function on a GDI Rectange() function on the screen to make it transparent. Is there some sample code to do this?
Thanks
|
|
|
|
|
Search for AlphaBlend or Transparent at codeproject. There are articles, FAQ, and totorials that cover this subject.
Good Luck!
INTP
|
|
|
|
|
Hi,
In my code, i read the system date with the following code,
SYSTEMTIME systime;
GetLocalTime ( &systime );
WORD day = systime.wDay;
WORD month = systime.wMonth;
WORD year = systime.wYear;
now, I would like to store it in this format, day/month/year as CString,.
how can I do that?
Ehsan Behboudi
|
|
|
|
|
CString strDate;
strData.Format(...); // works like printf
INTP
|
|
|
|
|
WORD day = systime.wDay;
WORD month = systime.wMonth;
WORD year = systime.wYear;
CString strDate;
strDate.Format("%u/%u/%u", year, month, day);
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
In the MFC try CTime::Format or strftime for Win32
"There is no monument dedicated to the memory of a committee." - Lester J. Pourciau
|
|
|
|
|
I agree with the previous poster. If you are using MFC either use CTime or COleDateTime and they both have a function to convert the time to a string in whatever format you need.
John
|
|
|
|
|
Hi !
We are developping an application in C++ with Visual Studio 6 SP5.
I'm compiling my application in Debug mode.
Since a few hours, when I run (with CTRL+F5) my application, it crashes. I have no idea why.
When I try to debug, and run it with F5 (debug), my application does not crash !
Doing some tests, I realised that showing a dummy message box at a certain point in my code make it work !
And, if I compile my application in release mode, it works fine !
My collegue, who is working on the same application doesn't have this problem. If I try to copy his sources directory in my own directory and to rebuild my app, I still have the problem.....
Any idea what's going on ????
Thanks !
Jerome
|
|
|
|
|
Jerome Conus wrote:
...when I run (with CTRL+F5) my application, it crashes.
Where? Is it at a certain point when you are interacting with it? Does it happen before a particular dialog is displayed? Define "crashes." Is this an unhandled exception? Does it also happen when ran from outside of the IDE?
Jerome Conus wrote:
Any idea what's going on ????
No, but this article might help.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Thanks, but as I said, the release version works fine. Only the debug version is crashing. If I execute the debug version (ctrl+f5) it's crashing, if I debug the debug version (f5) it's not crashing.
Jerome
|
|
|
|
|
It sounds like you are overwriting some memory location, the debug version is probably checking for this whereas the release version is not.
Assuming this is the reason it could be a M$ fault or one of yours, in cases like this I like to run the code through a program like Bounds Checker, it might solve the problem, it generally finds a few "bugs" for you that you did not know about!
"There is no monument dedicated to the memory of a committee." - Lester J. Pourciau
|
|
|
|
|
Jerome Conus wrote:
when I run (with CTRL+F5) my application, it crashes
and run it with F5 (debug), my application does not crash
Is it multithreaded? If so, you have a race condition that's dependent on your hardware, and doesn't show up in the debugger. The debugger suspends all threads except one, which totally changes the timing of when threads run.
--Mike--
Ericahist | CP SearchBar v2.0.2 | Homepage | 1ClickPicGrabber New v2.0! | RightClick-Encrypt
Pinky, are you pondering what I'm pondering?
I think so Brain, but how will we fit the hamster inside the accordion?
|
|
|
|
|
How do I append one Microsoft Word document to the end of another programmatically? I have tried Merge(), Merge2000(), Subdocuments() and PrintOut() to a file. The PrintOut() works, but does not generate a .doc file, just a .prn file. The documentation for Word automation is poor at best. I need an answer soon.
Duncan Wells
|
|
|
|
|
I do not think that it is possible to do so. Merging two MS Word Documents would require knowledge of the Word file format or APIs that read from the Word doc. And understandably, Microsoft is very reluctant to share those!!
One question:
Have you tried merging the two documents using a simple text editor like textpad or notepad? If you are unable to do so manually, chances are, you wont be able to write a program that does so.
|
|
|
|
|
Not sure about this, because I haven't tried it.
Could you not create a new blank document, open the first document, select the contents and do a copy and paste into the new document. Open the second one and copy and paste the contents to the end of the new document.
[edited as i screwed up the link]
This link may be useful, it's VB but it shouldn't be hard to convert[^]
Michael
But you know when the truth is told,
That you can get what you want or you can just get old,
Your're going to kick off before you even get halfway through.
When will you realise... Vienna waits for you? - "The Stranger," Billy Joel
|
|
|
|
|
I've been trying to avoid that alternative. Select, Copy, GOTO end and Paste. But essentially that's what I want to do. The other reply said it can't be done, but we know better. Anything can be done in software.
I do have a blank document (landscape) and a .dot file which has all the characteristics of the repeated format.
Interfacing with any MS automation object has it's drawbacks, but it does procude good results when figured out. I do considerable work with embedded Word, Excel and Access.
If you know of a room or site where I can communicate with other who do the same type of work, let me know.
Thanks,
Duncan
|
|
|
|
|
Duncan Wells wrote:
If you know of a room or site where I can communicate with other who do the same type of work, let me know.
one of the microsoft.public.office.developer.* newsgroups may be the best bet.
Michael
But you know when the truth is told,
That you can get what you want or you can just get old,
Your're going to kick off before you even get halfway through.
When will you realise... Vienna waits for you? - "The Stranger," Billy Joel
|
|
|
|
|