|
viral_umang@hotmail.com wrote: hi want change virtual key code from ascii(65) to ascii(235) in my windows hook dll.
i able to do upto ascii(127) i.e. 7 bit but not 8th bit. can any one help how to do so.
I don't know what you are trying to do but it looks like you are using a char instead of an unsigned char. A char is signed so it goes up to 127 and not 255.
|
|
|
|
|
hi,
thank you very much to reply so fast.
i am from india, i have created keyboard hook for changing the keyboard's key's from
say 'a' to 'b' so, i am able to get 'b' when i press key 'a' of my keyboard.
I am able to do this by changing the vitrual keycode in my hook procedure.
so i want now is that i should get a font's symbol at 235 but i am not able to get the
virtual key code for ascii 235.
thanks,
Viral
|
|
|
|
|
Well, you don't provide a lot of information do you ? Did you check what I said in my previous post ? Can you post the code because it is impossible what you did wrong by just guessing it.
|
|
|
|
|
viral_umang@hotmail.com wrote: i able to do upto ascii(127) i.e. 7 bit but not 8th bit. can any one help how to do so.
Wat r u using , char, try using TCHAR.
Apurv
|
|
|
|
|
Hi all,
Its a simple console application to calculate quotation. Well its working fine but problem i am facing is i want to store the quotation to the file everytime when entered and also i want the text file to be displayed as output with all the entries made in past....
This structure should contain all the customer record details ..
struct Quotes
{
int QuoteNumber;
char Name[20];
int DeliveryCost;
int CarpetCost;
short Guarantee;
};
The below functtion displays final output(quotation) for the user who just entered his details...
void DisplayRecord(int QuoteNum, char Name[], float Cost, float DeliveryCharge, int GuaranteePeriod )
{
cout << setfill(' ')
<< setw(7) << QuoteNum << " | "
<< setw(NAME_COL_WIDTH) << Name << " | "
<< setw(1) << POUND_SIGN << setw(COST_COL_WIDTH-4) << Cost << " | "
<< setw(1) << POUND_SIGN << setw(DELIVERY_COL_WIDTH-4) << DeliveryCharge << " | "
<< setw(1) << POUND_SIGN << setw(TOTAL_COL_WIDTH-1) << Cost + DeliveryCharge << " | "
<< setw(7) << "Years: " << setw(GUARANTEE_COL_WIDTH) << GuaranteePeriod << " | "
<< endl;
}
Now there is a file containing quotation of previous customers, and i can access all the data through below mentioned coding...
But the problem is that i am unable to include this peace of code with rest of the program.
At present, user enter details and he recieves output of the total cost n all and nothing else happens...now i want the details to be stored to the text file and also it can be displayed frm the stored text file as output...
InFile.open("Quotes.txt", ios::in);
if(InFile.is_open())
{
while(!InFile.eof())
{
InFile.getline(Buffer, BUFF_LEN);
Customer[CustNum].QuoteNumber = atoi(Buffer);
InFile.getline(Buffer, BUFF_LEN);
strcpy(Customer[CustNum].Name, Buffer);
InFile.getline(Buffer, BUFF_LEN);
Customer[CustNum].DeliveryCost = atoi(Buffer);
InFile.getline(Buffer, BUFF_LEN);
Customer[CustNum].CarpetCost = atoi(Buffer);
InFile.getline(Buffer, BUFF_LEN);
Customer[CustNum].Guarantee = atoi(Buffer);
CustNum++;
}
}
Can any one help me out in this. I have not written code for storing data to text file yet but once ill get the above problem working i.e. to read the past entries frm text file as output, then i would continue further.
the text file format is exactly like structure created i.e.
QuoteNumber
Name
DeliveryCost
CarpetCost
Guarantee
Any or all help would be greatly appreciated...
Thanks a lot for giving your valuable time to this thread...
|
|
|
|
|
Why not use the ReadFile function instead?
BOOL ReadFile(
HANDLE hFile,
LPVOID lpBuffer,
DWORD nNumberOfBytesToRead,
LPDWORD lpNumberOfBytesRead,
LPOVERLAPPED lpOverlapped
);
I.E.
HANDLE hFile;
char buffer[BUFSIZE];
DWORD dwBytesWritten;
BOOL fSuccess;
hFile = CreateFile(TEXT("C:\\test.txt"),
GENERIC_WRITE,
0,
NULL,
CREATE_ALWAYS,
FILE_ATTRIBUTE_NORMAL,
NULL);
fSuccess = ReadFile(hFile,
buffer,
strlen(buffer)+1,
&dwBytesWritten,
NULL);
http://msdn2.microsoft.com/en-us/library/aa365467.aspx[^]
When you have all the data in the lpBuffer you can add it to each structure variable.
This is just a suggestion ....
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
Programm3r wrote: hFile = CreateFile(TEXT("C:\\test.txt"),
Does this not produce an error for you?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Heh! Leave it to Microsoft to have an API called ReadFile that reads from a file opened for
writing.
Oh wait...maybe that was a typo
"Do you know what it's like to fall in the mud and get kicked... in the head... with an iron boot?
Of course you don't, no one does. It never happens. It's a dumb question... skip it."
|
|
|
|
|
I did some coding in VC++ to detect a device connected to the PC.
I used the sample coding from this siteitself...
LRESULT CHWDetectDlg::OnMyDeviceChange(WPARAM wParam, LPARAM lParam)
{
....
....
if ( DBT_DEVICEARRIVAL == wParam || DBT_DEVICEREMOVECOMPLETE == wParam ) {
PDEV_BROADCAST_HDR pHdr = (PDEV_BROADCAST_HDR)lParam;
switch( pHdr->dbch_devicetype ) {
case DBT_DEVTYP_DEVICEINTERFACE:
PDEV_BROADCAST_DEVICEINTERFACE pDevInf = (PDEV_BROADCAST_DEVICEINTERFACE)pHdr;
UpdateDevice(pDevInf, wParam);
break;
....
....
}
Here in this code wParam should contain either DBT_DEVICEARRIVAL or
DBT_DEVICEREMOVECOMPLETE ...
But it contains DBT_DEVNODES_CHANGED i.e it is detecting there is some device node changes when any device is inserted or removed..
But i want to know whether it is inserted or removed so that it will go into theloop in the above code...
How to proceed...
Waiting for suggestions..
Regards
vijay
|
|
|
|
|
Hi all,
I Want to Know About
1) Why can't we directly instantiate an Abstract Class, and why we have to create it by its Derived Class only.
2) What is the Difference between an Abstract Class and an Interface in COM.
Please give your suggestions.
Uday kiran
|
|
|
|
|
uday kiran janaswamy wrote: 1) Why can't we directly instantiate an Abstract Class, and why we have to create it by its Derived Class only.
Because that's one of the C++ feature (and it is a very valuable feature: it prevents user to instantiate classes that are not supposed to be instancied). By supplying at least one pure virtual function, your class is abstract:
CMyClass
{
virtual void MyFunc() = 0;
};
uday kiran janaswamy wrote: 2) What is the Difference between an Abstract Class and an Interface in COM.
For me (but I don't know if this is totally true), an abstract class is a class that cannot be instantiated directly (meaning it has at least one pure virtual function). A interface is a "pure abstract class": a class that has only member functions (no member variables) and all of them are pure virtual. In fact this class has no functionality at all, it is just an interface to a class that implements those functionalities.
|
|
|
|
|
Thanks Cedric Moonen you have given a most valuable information about Abstract Class and an Interface.
Uday kiran
|
|
|
|
|
uday kiran janaswamy wrote: 1) Why can't we directly instantiate an Abstract Class, and why we have to create it by its Derived Class only.
Because, its not complete on its own.
uday kiran janaswamy wrote: 2) What is the Difference between an Abstract Class and an Interface in COM.
To add to Cedric, abstract class can have some functions with definitions. But that could not be case with interface, It will have only pure virtual fucntions.
To stick to this, later VS compiler provide keyword __interface .
|
|
|
|
|
prasad_som wrote: To add to Cedric, abstract class can have some functions with definitions.
Well, it was implicitely stated: the only restriction of an abstract class is that it cannot be instanciated (so at least one pure virtual function). Now, you can have whatever you want in the class (even member variables).
|
|
|
|
|
Cedric Moonen wrote: Well, it was implicitely stated
I mentioned this to differentiate it from interface . And should be.
|
|
|
|
|
uday kiran janaswamy wrote: What is the Difference between an Abstract Class and an Interface in COM.
a COM interface has more constraints (or features) than an C++ abstract class, i.e. a COM interface is an abstract class:
(1) having only methods.
(2) having a unique global identifier.
(3) exposing, at least, the methods of the IUnknown interface (QueryInterface , AddRef , Release ).
hope that helps
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
hi
i am satheesh .
i am Begnier for vc++ programming .
so i need help for develope my knowlege.
currently i am developing one project in PROE CAD came model using vc++.
vc++ using preprosser. so i need some help for all
MY qustione
1.How to creat DLL Library in vc++ .
2.how to convert DLL File to .exe file.
|
|
|
|
|
Satheeshkumar_Balakrishnan wrote: How to creat DLL Library in vc++ .
Depends of your IDE but in general you can choose that when you create your project.
Satheeshkumar_Balakrishnan wrote: how to convert DLL File to .exe file.
You can't directly. You need to create a new project and the files you want to add in your exe. You cannot convert a DLL into a exe, these are two totally different things.
Satheeshkumar_Balakrishnan wrote: vc++ using preprosser
What's a preprosser ?
|
|
|
|
|
I think he meant pre-processor??
John P.
|
|
|
|
|
That's what I first guessed but then his sentence doesn't make any sense...
|
|
|
|
|
For first your question codeproject has a lot of articles about create dll.Articles on DLLs[^]
For second question what does mean convert dll to exe
|
|
|
|
|
Hi All,
I have created a MDI application. I open two child windows in the MDI (by clicking File-> New).
I will draw a rectangle in one child window.
I need to drag the rectangle from one child window and drop into another.
Any solutions or ideas???
Thank You.
|
|
|
|
|
You requirement seems to be weired. There is know way a rectangle drawn can be candidate for drag and drop operation.
|
|
|
|
|
Then your application should be both an ole server and a client.
MFC has a greate support for that. See COleDropTarget, COleDropSource documentation.
--
======
Arman
|
|
|
|
|
Just a drawn rectangle needs to be dragged?
Which part is giving you trouble - drawing the rectangle, notifying the receiving window of the
drop, dragging in general, something else?
Mark
"Do you know what it's like to fall in the mud and get kicked... in the head... with an iron boot?
Of course you don't, no one does. It never happens. It's a dumb question... skip it."
|
|
|
|