|
strCurrency.Format("%.2f",nNumber);
|
|
|
|
|
where do i get nNumber? i only have the COleCurrency, the only conversion that is possible is COleCurrency => CString(or do i get this wrong)
[]D [] []D []
|
|
|
|
|
I haven't used COleCurrency, just COleTime.. if it only returns a string you could do a float nNumber = atof(string).. this would produce the number nNumber.. then you could format this number as i posted before..
Hope this helps..
Rob
|
|
|
|
|
thnx.... i already found another solution
|
|
|
|
|
I'm trying to export a template class from a DLL...
For this, I use AFX_EXT_CLASS.
I observe (with a DLL viewer) that a template class can't be export from a DLL but a simple class well... Is this normal? A solution?
Here is some of my header code:
A simple class... : the class is exported, OK
class AFX_EXT_CLASS FIFO
{
public:
enum tagBUFFER_STATUS{ FREE = 0x00, BUSY = 0x01 };
struct tagARRAY {
int _buf;
tagBUFFER_STATUS _sts;
};
DWORD In(int& value);
DWORD Out(int& value);
FIFO();
virtual ~FIFO();
private:
tagARRAY _array[10];
int _itr;
int _itw;
};
A template class... : the class is not exported, KO
template<class T, int Size>
class AFX_EXT_CLASS FIFO
{
public:
enum tagBUFFER_STATUS{ FREE = 0x00, BUSY = 0x01 };
struct tagARRAY {
int _buf;
tagBUFFER_STATUS _sts;
};
DWORD In(T& value);
DWORD Out(T& value);
FIFO();
virtual ~FIFO();
private:
tagARRAY _array[Size];
int _itr;
int _itw;
};
My question: how to export a template class from a DLL?
Thanks for your help...
Hello World!!!
from Raphaël
|
|
|
|
|
Raphaël Kindt wrote:
how to export a template class from a DLL?
It's not possible. The compiler generates code only for concrete implementations of the class. Otherwise it only does some syntax and type checking.
Look at the ATL classes' implementation, it's written entirely in the header files.
rechi
|
|
|
|
|
Bogdan Rechi wrote:
It's not possible
I'm not sur because I found this in MDSN library:
Explicit instantiation lets you create an instantiation of a templated class or function without actually using it in your code. Since this is useful when you are creating library (.LIB) files that use templates for distribution, uninstantiated template definitions are not put into object (.OBJ) files.
But I can be mistaken...
Hello World!!!
from Raphaël
|
|
|
|
|
MSDN wrote:
Explicit instantiation...
The explicit instantiation is a particularized version of the template class. You can export a finite number of versions for your class, that's true. But there are template classes that support an infinite number of versions. What about them? Do you intend to write all the versions for such a class?
rechi
|
|
|
|
|
nop... you're right...;)
Thanks for your reply...
Hello World!!!
from Raphaël
|
|
|
|
|
Hi Y'all!
How can i calculate the number of files in a folder programmatically in a
Win32 API Application???
|
|
|
|
|
I don't know if this is the best choice but: "use FindFirstFile , FindNextFile , FindClose "
Funny how the history is repeating...
rechi
|
|
|
|
|
|
My main application thread starts a auxillary UI thread in order to display a dialog and show some progress information. The main app thread updates the auxillary thread's dialog with information it processes.
The problem: What is the best way to let the main app thread know that the auxillary thread is started and that the dialog is loaded(displayed) and ready for input?
Gary Kirkham
A working Program is one that has only unobserved bugs
I thought I wanted a career, turns out I just wanted paychecks
|
|
|
|
|
if the main thread is a ui tread .. you can use PostMessage function to notify it
|
|
|
|
|
|
for ms OS 95/98/00/ME/XP.../NT etc, which one do you think is best and worst?
the post is just for general knowledge.
thx
includeh10
|
|
|
|
|
depends on what you need it for.
W95 - is out of the picture W98 is improved version of it
W98 - excellent for home environment and computer-illiterate people. Bad memory management, no security, no true, multitasking, no UNICODE.
W ME - same as 98, but seems to be less stable.
Nt4 - excellent professional system (security, multitasking, stability + good memory management and native support for UNICODE), true services. Relatively difficult to configure, no hardware wizards.
W2K - significantly improved version of NT4 (with hardware wizard), there is better memory management and improved security. From developers standpoint it has much better APIs. Do not forget telnet and COM+.
Win XP - same as W2k, but seems to be less stable especially with older software and drivers (the once that rejected by wizards). The concept of the WindowStation is improved but seems to be exposing the system (security and stability wise)
|
|
|
|
|
for w2k and win XP don't forget the IO Completion Ports for network connections, they rule...
[]D [] []D []
|
|
|
|
|
Yeeah, forgot that... and I agree they rock
|
|
|
|
|
From the C++ coder 's point of view, i think the NT family is the best because it has more useful technologies then the previous and also is more stable while programming.
From any other point of view, you could have had infinite superior chances to be answerd if you would have post it in the Lounge
rechi
|
|
|
|
|
Hello,
in MDI project,to open a new document (like File->New), i do this :
AfxGetApp()->OnCmdMsg(ID_FILE_NEW, 0, NULL, NULL);
Is it possible to open new document with specific height and width ?
Thx in advance
|
|
|
|
|
I create a zip file and do not want winzip to open it. that is say I have a.zip now I only want my app to be able to open this file and not winzip. Once my app takes control then winzip can be used internally to extract the file contents. Any idea?
|
|
|
|
|
Add your own header onto the start, confusing winzip. Then when your app opens it, strip the header off, and get winzip to unzip the original zip. Messy and ineffecient yes, but easy.
|
|
|
|
|
How do you "get winzip unzip the original zip"? Does winzip support command line parameters or is there anyway to make winzip work for my own application? Thanks.
|
|
|
|
|
Winzip does support command line parameters, it is a add-on. You can download it from their web site.
Jonathan Craig
www.mcw-tech.com
|
|
|
|