|
Hi,
<br />
CreateFile( "FullFilePath", GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);<br />
e.g. with FullFilePath = "C:\\MyDir\\MyApp\\debug\\filename.ini"
or get the directory with: GetCurrentDirectory(...)
or otherwise with: GetModuleFileName(...) + _splitpath(...)
HTH
Frank
-- modified at 7:43 Monday 4th December, 2006
|
|
|
|
|
Thank you soo much for your help..
|
|
|
|
|
or you can use
<br />
CFile::Open->CFile::modeCreate | CFile::modeWrite
|
|
|
|
|
Thanks you very much for your help..
|
|
|
|
|
Shah Satish wrote: how i can create "filename.ini" file when i debug my program
In addition to what the others have indicated about creating the file. If you want to just create the file while in a debug build use
#ifdef DEBUG
...
#endif
I'd love to help, but unfortunatley I have prior commitments monitoring the length of my grass. :Andrew Bleakley:
|
|
|
|
|
Shah Satish wrote:
an any body tell me ,how i can create "filename.ini" file when i debug my program..ie when i debug then "Filename.ini" file automatically create in debug folder of my project (or specified path)
how i can...??
ols C and C++ runtime function still work in VC++ like FSTREAM or fopen!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
Hi,
I have a problem with regards to ignoring mouse events.
Here is my requirement :
I have an application where some dialogs need to ignore mouse message and some dialogs should not
Solutions tried :
1. I have tried installing a mouse hook. But, in the mouse processor I need to always check the window pointer and its parents to determine whether I need to ignore and all call the next hook
Is there any member funciton/message handler of CDialog class by which we can ignore all mouse events/messages for that particular dialog ?
Appreciate any help that I can get
Regards,
Hari
I have a class dervied from CDialog and wants to ignore all the mouse message coming to the windows. I have used a solution
|
|
|
|
|
All I can think of is PreTanslateMessage... Something like this:
<br />
BOOL CCrossTabQuestionPage::PreTranslateMessage(MSG* pMsg) <br />
{<br />
switch ( pMsg->message )<br />
{<br />
case WM_LBUTTONDOWN:<br />
case WM_LBUTTONUP:<br />
return true;<br />
}<br />
<br />
return CDialog::PreTranslateMessage(pMsg);<br />
}<br />
<br />
This is likely to work but I have not tested it!
|
|
|
|
|
overide the OnNcHitTest() function and return HTNOWHERE inside it
nave
|
|
|
|
|
Haribaskar wrote: 1. I have tried installing a mouse hook. But, in the mouse processor I need to always check the window pointer and its parents to determine whether I need to ignore and all call the next hook
Global Hook or local Hook!
Haribaskar wrote: Is there any member funciton/message handler of CDialog class by which we can ignore all mouse events/messages for that particular dialog ?
naah.. you have to check every dialog or hook only particular dialog!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
Hi,
Can someone direct me (maybe a link or tutorial) on how to write a program to print to a Dot-Matrix printer. I need total control of which characters to print and will also need to send printer commands to the printer, i.e to move the head on vertical tab etc. (I already have the printer commands)
Any help would be appreciated.
Thanks in advance
Pieter
|
|
|
|
|
If you are using fprintf() , then open "LPT1:" as the file stream.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi Everybody,
I need help related to IP address and MAC Address. I have a network device "Mini port" from Lantronix, which is used for to retrive data from serial port and send it to LAN network, my requirement is, In the initial stage it will have only MAC address known by user, I want to search for the MAC Address and assign IP address for the same like in "print server". If anybody have solution for the same, please let me know in details.
Thanks in advance,
Ajith
Ajith
|
|
|
|
|
The IP Helper API has GetAdaptersInfo()[^] (GetAdaptersAddresses() in XP+). This may help you match up MAC and IP addresses.
Mark
|
|
|
|
|
Hi!!
can any body tell me ,how i can create "blabla.ini" file when i debug my program..ie when i will debug then blabla.ini file automatically generate in debug folder inside of my project.
how i can...??
Thanking you
shah satish
|
|
|
|
|
What is this "blabla.ini" file ? What are you trying to do exactly ?
|
|
|
|
|
blabla.ini means name of the file..
for exmaple...when i debug my program then it will generate webdocu.ini..
i dont know how i can create automatically file when i debug my program.
Thanks for your reply n waiting for your reply..
shah satish
|
|
|
|
|
in this file name i can enter my data.. ie this is user manual data..
|
|
|
|
|
in this file name i can enter my data.. ie this is user manual data..
shah satish
|
|
|
|
|
I think you need the information of the functions that are executed during the execution of your exe. For this you need to go to (VS .NET 2003) Linker settings under your project settings. there you can find an option for debugging. Enter "blabla.ini" or whatever for the map file to be generated and set map exports and map lines to /MAPINFO:EXPORTS and /MAPINFO:LINES respectively.
Run the application. You can find the file in your project folder.
See if this is what you need/ask for in your query.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Shah Satish wrote: can any body tell me ,how i can create "blabla.ini" file...
You would create it in the same fashion that you would create any other file. The name of the file is not important in how it is created.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi,
am trying to develop in vc++6.00 , a windows form which automatically generates and inserts a random 6 digit number in a text box. Have toyed with rand() but as yet cannot get this to function correctly, any advice or pointers please.
thnx
panduran
Developer just starting out..
|
|
|
|
|
rand() generates a number. You need to use sprintf or similar ( ostringstream is my choice ), to turn it into a string.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
panduran wrote: ...a random 6 digit number in a text box. Have toyed with rand()...
You do realize that rand() returns a pseudo-random number between 0 and RAND_MAX , don't you? That said, you'll need to left-pad the result with at least one 0.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
panduran wrote: am trying to develop in vc++6.00 , a windows form which automatically generates and inserts a random 6 digit number in a text box. Have toyed with rand() but a
int iRandomNo=0;
srand(GetTockCount());
for(int i=0;i<6;i++)
{
iRandomNo = iRandomNo*10 + rand()/10;
}
SetDlgItemInt(ID_TEXTBOX,iRandomNo);
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|