|
1) The \windows directory
2) It's an INI file, however for deleting it's harder because the format is:
[rename]
NUL=C:\temp\file1.exe
NUL=C:\foo\file2.exe and so on. You can't use WritePrivateProfileString() because the second NUL line would replace the first. You need to read the whole file in, modify it, and write it back out. I know I saw an MSDN article with code to do this, but I can't find it now.
--Mike--
LINKS~! Ericahist updated! | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ
Strange things are afoot at the U+004B U+20DD
|
|
|
|
|
hi mike,
your comment is the same as doc in VC doc about function MoveFileEx().
i write this pice of code manually to ininit.ini, but none of files are deleted after reboot.
headache.
includeh10
|
|
|
|
|
to delete an dll (COM) file programmatically which is used by system.
MoveFileEx() can do that if reboot system by the function is unavailable on win95/98.
is there a function (reboot is fine) for win95/98 which can delete a file used by system?
thx
includeh10
|
|
|
|
|
Dosen't win95/98 allows you to delete the COM dll if its loaded also ?
suhredayan There is no spoon.
|
|
|
|
|
Hi there!
in 95/98 system you can write in WINinit.ini for deleting the file at reboot.
I have seen article relating to this in CP ,but can't able to find that today.
I think you have to find that your self
"I Think this Will Help"
[Vote One Here,.....]
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
is there any way that i can write a generalized program to dynamically detect
any number of Dll in a folder and statically link them.
upto now i have my application that statically links and implicitly loads the dlls. i will detect the newly added dlls and keeps information in File.The infor
mation in the file and registry information is enough. The problem is how i can
my appliation understand the new dlls, how can oi include the headerfiles.
IS THERE ANY POSSIBILITY
|
|
|
|
|
As far as I know, this isn't possible.
Static linking implies that all code be known and identified at link-time, static linking is effectivly dynamic linking with hidden 'glue' that uses staticly bound stubs to dispatch to the dll.
This is possible and very simple to do with dynamic linking provided your class heirarchy supports it.
|
|
|
|
|
Can someone tell me the basic difference between a vector,list and dqueue. just the basic difference is appreciated.
|
|
|
|
|
They all have slightly different performance specifications and operations which make them suitable for different tasks.
std::vector is a dynamic array
std::list is a doubly linked list
std::deque is a hybrid container which is like a list of vectors (from memory)
By default, use a vector.
If you need to add to the front and the back, use a deque.
If you need to be able to insert/remove efficiently from the middle of a container, and never need random access use a list.
|
|
|
|
|
hi there,
<br />
char buf[1024];<br />
StrFormatByteSize(5*1024*1024*1024, buf, 1024 );
unsigned long size = 5368709120;
StrFormatByteSizeA(5368709120, buf, 1024);
(a), (b) is supposed to be 5G Bytes, am i right?
but StrFormatByteSize gave me 1G Bytes
what did i do wrong?
ie version is 6
thanks for your time
|
|
|
|
|
The first param of StrFormatByteSizeA() is a DWORD , 5GB overflows a DWORD . From the docs:The first parameter of this function has a different type for the ANSI and Unicode versions. If your numeric value is a DWORD, you can use StrFormatByteSize with text macros for both cases. The compiler will cast the numerical value to a LONGLONG for the Unicode case. If your numerical value is a LONGLONG, you should use StrFormatByteSizeW explicitly.
--Mike--
LINKS~! Ericahist updated! | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ
Strange things are afoot at the U+004B U+20DD
|
|
|
|
|
it works!
|
|
|
|
|
Hi:
In C there is sqrt( ) function which gets the square root of any number. The sqrt(4) = 2 which is = 2 x 2.
I wonder how could I use it to find the 3rd order root, for example sqrt3(8)=2, which is = 2x2x2.
Thanks in advance.
joe,
|
|
|
|
|
Look at the pow(x, y) function.
Steve
|
|
|
|
|
|
What's the easiest way to drop the 0 on .233 floating point variable when displaying.
I'm using visual studio .net c++ for compiler.
Thanks!
|
|
|
|
|
using the format string "%4.3f" should do the trick.
Steve
|
|
|
|
|
Thanks, do you have an alternative solution, I'm not allowed to use printf type functions in my visual studio.net c++ program code.
Thanks!
|
|
|
|
|
I'm surprised that you are not allowed to use something like
CString str;
float xnum = 0.123;
str.Format("%4.3f", xnum);
[equivalent to char str[8]; sprintf(str, "4.3f", xnum);]
-------------------------------
but you can also use _fcvt
int decimal, sign;
char *buffer;
double source = 0.123;
buffer = _fcvt( source, 3, &decimal, &sign);
--------------
result:
buffer = "123"
decimal = 0;
sign = 0;
from MSDN:
"The _fcvt function converts a floating-point number to a null-terminated character string. The value parameter is the floating-point number to be converted. _fcvt stores the digits of value as a string and appends a null character ('\0'). The count parameter specifies the number of digits to be stored after the decimal point. Excess digits are rounded off to count places. If there are fewer than count digits of precision, the string is padded with zeros.
Only digits are stored in the string. The position of the decimal point and the sign of value can be obtained from dec and sign after the call. The dec parameter points to an integer value; this integer value gives the position of the decimal point with respect to the beginning of the string. A zero or negative integer value indicates that the decimal point lies to the left of the first digit. The parameter sign points to an integer indicating the sign of value. The integer is set to 0 if value is positive and is set to a nonzero number if value is negative."
-------------------------
Note that you will get last digit rounding.
You did not indicate if you have to manually do the conversion.
Steve
|
|
|
|
|
Im still new at this. Ive been trying for days, but I still cannot populate a list box from a text file. I need a method. Ive been instructed to read into CList and CStdioFile classes. Prying into the help file to understand this, I came away more confused than ever.
Surely, this is a standard operation! Isn't there a hard and fast method for doing this?
Help! Im desperate!
Travis
|
|
|
|
|
macrophobia wrote:
Isn't there a hard and fast method for doing this?
No.
Permit me to offer an analogy: millions of people use their car to drive to work. Their route is usually a fixed one (from home to work). Yet, no car offers a magic button labelled "Drive to work". You have to:- Start the car.
- Navigate your route to work (by using the accelerator, brake, gears and steering wheel).
- Park the car.
- Turn off the engine.
It's the same with your programming problem. You need to:- Open the file for reading.
- Read each line (see
CStdioFile ).
- Add each line to the list box (see
CListBox ).
- If there are more lines to read, return to step 2.
- Close the file.
That's what programming is all about. Lots of little instructions that allow you to perform a task.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Im coming to that conclusion every day. At least with Assembly language, I expected it. I guess Ive been hoping that all the magic routes have been paved for me with C++.
Thank you for your reply. I'll use your steps to help me put this thing together.
Travis
|
|
|
|
|
Good luck! And feel free to ask questions - we're here to help.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Thank you for making me feel welcomed! I hope to help people some day. (By the looks of things, it will take years! There is alot to know!)
Travis
|
|
|
|
|
That is not necessarily true, just look at how much you have learned in a short period of time...
Steve
|
|
|
|