|
Go back to my major problem. In Win98, can I get such information as total Cylinders, TracksPerCylinder...?
Best regards.
____
Tuan
|
|
|
|
|
Given the Windows 98 restriction, I know of no way. You might try posing your question to the microsoft.public.vc.language newsgroup.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Dear David,
How can I do that? I mean how i can post my question to that newsgroup?
BRs.
____
Tuan
|
|
|
|
|
I use Outlook Express. You can also use Google.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Well, this seems to be a trivial question, but it's giving me problems, so I've decided to claim for someone's help.
In a Win32/MFC application, some kinds of resource (as images, for example) are stored in independent files, wich can be easily accessed and modified. I pretend to have some of these resources encapsulated and/or secured in such a way that they are not trivially engaged by users. This surely implies to provide some kind of encapsulation in order to have not first-look recognizable files. But I was thinking, too, in adding such resources directly inside the executable file.
I don't know if I've explained this clearly enough, and I know that my English is too far from correctness. But if someone could help me, no matter in what way, I'd be very pleased. Thanks for all.
|
|
|
|
|
I want to get a handle of a thread of other process in the Win9x.
but th API OpenThread() only can work in Win2K or later.
The best I've managed to do so far is:
DebugActiveProcess()
while( WaitForDebugEvent(&debug_event, ...))
{
....
ContinueDebugEvent()
}
Which will enumerate every thread in a process, filling a DEBUG_EVENT
structure with each thread's handle.
This works, but it's not the prettiest way to do it.
It also has the very unfortunate side-effect of attaching the process as a
child of this one.
What should I do ? Please help me , Thanks a lot!
|
|
|
|
|
Interesting.
As far as I know, you cannot get a handle to a thread from another process because of security reason. The only way is if you spawn the process via CreateProcess(), etc.
Kuphryn
|
|
|
|
|
I met a problem in MFC extension dll creation and I write to seek your kind assistance.
I created two project: Main.dsw and server.dsw ;
[1] In Server.dsw, I defined a series of classes, derived from CObject, and implemented them with serrialization support;
[2] In Main.dsw, in the document class, I defined a TypedList like this:
typedef CTypedPtrList<coblist, cobject*=""> CActor;
void CXXXDoc::Serialize(CArchive& ar)
{
Actor.Serialize (ar);
}
I then added some objects in this document, all these objects are instances from Server classes;
The problem is, every time I save the document, and then reopen the saved document, a "Unexpected file format" error pops up.
I debugged into the code, and found that it occurs in CObList.Serialize();
However, if I do not encapsulate the classes into server.dll, instead, I directly use them in Main.dsw (I put the source code in main.dsw ), the serialization is ok. This is so strange. Can anyone give me some hints on this?
I have been working on this for half a month, and searched MSDN for quite a few days, will you pls give me a hand?
Your kind help is highly appreciated.
|
|
|
|
|
i need a mouse detector tool, especifically develop it,
because i'm a software developper, and i need to do it in my software, i hear about using direct driver access, but in this moment i dont know about driver develop or how to access it, if you know any way to detect a mouse presence in real time, please let me know it.
any thing to do ? where to find it, how to develop it ?
please help me and thanks a lot
------------------------------
christian s.
unhandledexception@hotmail.com
------------------------------
|
|
|
|
|
How about GetSystemMetrics(SM_MOUSEPRESENT) ?
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Hi there.
I'm having a problem with a project i'm currently working on.
I'm writing an MFC extension dll to simplify the reusability of code that i've written. The Project itself is called "STHDll" and i added all necessary
files to it. It currently has the two standard configurations (DEBUG and RELEASE).
In the Project's linker tab i use the following command line:
(Release)
/nologo /subsystem:windows /dll /machine:I386 /out:"../bin/STHLib.dll" /implib:"../lib/STHLib.lib"
(Debug)
/nologo /subsystem:windows /dll /machine:I386 /out:"../bin/STHLibD.dll" /implib:"../lib/STHLibD.lib"
Now if i compile it the linker gives a warning: LNK4070
STHLibD.exp : warning LNK4070: /OUT:STHDll.dll filename directive in .EXP differs from output filename "../Bin/STHLibD.dll"; ignoring directive
Now if i open the .exp file i only find references for "STHDll.dll".
Teh same is for the .lib file.
Can anybody help me with this problem, so that i can create the proper .exp
and .lib files?
Many Thanks.
Optimus Chaos
|
|
|
|
|
hi,
After I installed the latest PSDK ,
When I try to compile I get the message '...\rc.exe This program expects a newer version of windows'.
I am running ME.
what could be wrong with the resource compiler?
I am using VC6 SP5 , with latest platform SDK.
regards
Hari
Hari Krishnan
|
|
|
|
|
I have this same environment at home and have no troubles compiling (this is in contrast to Michael's comment about Microsoft disabling the product). Perhaps you need to reinstall SP5 with the thought that it might provide the "correct" resource compiler.
What happens if you run the resource compiler from a command prompt? Change to the C:\Program Files\Microsoft Visual Studio\Common\MSDev98\Bin folder, type rc, and see if it gives you the "...\rc.exe This program expects..." or the RC1107 message.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
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
|
|
|
|
|