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