I think that it isn't the case. If you forget the std namespace, you will get an Undeclared identifier error, not linker error. Robert-Antonio "What do you mean, I can't initialize things in an assert()?"
Robert A T Kaldy
Posts
-
Error Link in VC++ -
How to Set the controls to be infront of an ImageCall
SetWindowPos(wndTop, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE)
to all hidden controls. Robert-Antonio "It's a good luck, when you meet a real fink. Then you get a respect to normal, mid-honest people." -
Error Link in VC++The
ocl.lib
is your or third-party library? Robert-Antonio "Friends come and leave, but teddybears stay in forever." -
Dialog with different controls created at runtimeThe simplest approach is, that you create all controls in Dialog editor. In
OnInitDialog
you parse the keywords and setCWnd::ModifyStyle(WS_VISIBLE, 0, 0)
to appropriate controls. This function makes the controls invisible. Robert-Antonio "Love without sex is like a fish without antlers" -
how to use ::*Try this:
class A
{
public:
void f() { printf("Hello\n"); }
};void Test(void (A::*fun)(void))
{
A a;
(a.*fun)();
};void main()
{
Test(&A::f);
}If you call a non-static function via pointer-to-member, you have to specify a instance of class, that is passed to the member function. Robert-Antonio "Love, truth and electric traction must gain victory over hate, lie and diesel traction."
-
Sending SMS to any Mobile thru Visual C++ codeCom-port => you need the serial communication library. There's plenty of free c++ serial communication libraries, try google. For detailed info about AT commands see documentation for partial type of your mobile phone. For example, look at scmxx library for communicating with Siemens mobiles. You can read many useful commands from the scmxx source code :). Good luck! Robert-Antonio "A piece of paper is an ink-lined plane. An inclined plane is slope up. A slow pup is a lazy dog. Q.E.D.: A piece of paper is a lazy dog."
-
Convert to UnicodeSo it's simple. If the Devangari charset is default on your system, use
mbstowcs
. When not, useMultiByteToWideChar
, where you supply the Devangari charset codepage number. See MSDN for details about these functions. Robert-Antonio -
where can i find win98 source code ???Oooops! Your teacher wants to crack the code and make a GNU OS Win98, yeah? I think that this code is good enough for him :laugh: Robert-Antonio
-
Sending SMS to any Mobile thru Visual C++ codeUnfortunately, all free C/C++ libraries for mobile communications, that I know, are designed only for particular type and connection. So I'd like to know: 1. What type of mobile do you have (Siemens, Nokia...?) 2. How do you connect to the mobile (serial line, USB, Bluetooth?) Robert-Antonio
-
Convert to UnicodeDo you have the Devangari charset in your Windows localization? Robert-Antonio "Friends come and leave, but teddybears stay in forever."
-
Convert to UnicodeI don't know, what is a Custom font. But generally, if you want to convert characters from Windows-125* (depending of localization of the OS) to Unicode encoding, use
mbstowcs()
function. Robert-Antonio "Love, truth and electric traction must gain victory over hate, lie and diesel traction." -
BYTE array and listsCode short and fast:
BYTE* byte_array; std::list<char> char_list; char_list.assign(byte_array, byte_array + number_of_entries_in_byte_array);
:-D Robert-Antonio "A flower walked around a meadow. She saw a beautiful human and plucked off his head." -
Decode a UTF-8 file to a CString?Try
MultiByteToWideChar(..)
. Robert-Antonio "What do you mean, I can't initialize things in assert()?" -
change variable valueThe standard approach is to store the password value in encrypted form in an inifile or registry. When the program asks for the password, it encrypts the user's input and compare the encypted user's input with the encrypted password from registry. If they are equal, the user's password is correct. For encrypting, you should use SHA hashing algorithm. Try google for 'SHA C++ library'. Robert-Antonio Endless loop: see Loop, endless Loop, endless: see Endless loop
-
MFC CDialog InheritanceIf the
CWnd::Create
function is overridden inCDialog
, you can inCDialog
and derived classes use only the overridden versions. To force the non-overriddenCWnd::Create
call, useCDerivedDialog dlg; dlg.CWnd::Create(...);
Robert-Antonio "A flower walked around a meadow. She saw a beatiful human and plucked off his head." -
C2065 Compiler error.If you change something in
stdafx.h
you must recompile (manually) the filestdafx.cpp
to update the precompiled header. Robert-Antonio "Love without sex is like a fish without antlers" -
C++ and ExcelThere is a windows version of awk. And I think, that sed and grep exist for windows too, try google. Robert-Antonio "I launched Norton Commander and saw, drive C: on the left, drive C: on the right...Damn, why I need two drives C:??? So I formatted one..."
-
Compression : Some new Idea.Your basic idea is good. You take advantage that text files contain bytes from a relatively small set (26 small and 26 capital letters), so the differences would be small. Yes, the result should be smaller than source. But read a specification of the LZW algorithm, it is a classic compression approach, when the source file contains bytes from a small set. It brings you idea even deeper. Robert-Antonio "I launched Norton Commander and saw, drive C: on the left, drive C: on the right...Damn, why I need two drives C:??? So I formatted one..."
-
MRU in a dialog box appThis solution isn't dependent on doc/view. If you want to add MRU to dialog box, use simply
CYourDialog
instead ofCMainFrame
Robert-Antonio "Love without sex is like a fish without antlers" -
My dialog doesn't get focusDid you set the pointer to the first dialog as a parent of the second? Robert-Antonio "Give a man a fish, he owes you one fish. Teach a man to fish, you give up your monopoly on fisheries."