|
Well it is a bit of an assumption on my part, but if xDontcare is just a char *, then the
xDontcare ="xxxxx";
sets xDontcare to point to a readonly string.
Tim Smith
"Programmers are always surrounded by complexity; we can not avoid it... If our basic tool, the language in which we design and code our programs, is also complicated, the language itself becomes part of the problem rather that part of the solution."
Hoare - 1980 ACM Turing Award Lecture
|
|
|
|
|
Okay> I can comprehend that. THanks. Now I have to rack my brains for an alternative...
ns
|
|
|
|
|
#define dontCare "dontcare";
char szDontCare [64];
strcpy (szDontCare, dontCare);
for (char* pc = szDontCare; (*pc != '\0'); pc++) {
*pc ^= 0x30;
} Please don't write code like this:
while (*pc) {
...
} It makes me weep. Do this instead:
while (*pc != '\0') {
...
} Why? Because it's easier to maintain. And maintenance costs about 4x development.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Hey! Your'e back!!! Been a while.
Thanks for the resolution. I'll try it very soon - I see sort of why its not happy. Pretty tricky.
|
|
|
|
|
Heh.
How are you?
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Okay I guess. Stuffs coming along so I cant complain. Lotsa little and big challenges every day. Missed you around -
Getting a new pc at work next month - hurray. I think I can spend upto 2500. Should be able to get a cool one. No XP allowed here though - so it will have to be (rolled back? ) to win2k. Oh well.
|
|
|
|
|
W2K is a good idea. For $2.5K you can get yourself a purty nice machine!
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Oh, BTW - I need three different files to be able to see my xDontCare variable. I had it as an extern. If I do a #define as you say how do I make everyone see it? I'm doing the xoring in OnInitialUpdate so its set once and for all....
|
|
|
|
|
I keep my globals in a singleton Globals class. That way, from anywhere in the code, I can do stuff like:
Globals* pGlobals = Globals::getGlobals();
ASSERT (pGlobals != NULL);
printf ("%s\n", pGlobals->getDontCareString()); The Globals constructor contains all the one-time initialization code. This makes for safe coding and easy maintenance. All you need to do is #include "Globals.h" in every .cpp file that references it.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
The Globals constructor contains all the one-time initialization code.
Sorry, I lied! It's the getGlobals() method that lazily initializes the object.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Well, the strategy as stated crashed because for some odd reason (I had declared an extern xdontcare[64]), copied a blank string when I did strcpy(xdontcare,"dontcare"), so instead I did
extern char* xdontcare
and in OnInitialUpdate I did:
xdontcare = new char[64]
strcpy(...)
then it worked. Wondering why? Maybe it has to do with the positioning of my xdontcare as a global...
(and yes, I havent implemented the Globals.h idea yet... )
|
|
|
|
|
It's crashing because the compiler may store string literals in read-only memory, because you aren't supposed to modify literals. Write it like this instead:
char xDontCare[] = "dontcare";
--Mike--
Just released - RightClick-Encrypt v1.4 - Adds fast & easy file encryption to Explorer
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
OK I have code that I thought I was ready to distribute - sadly it seems I "spoken" too soon.
I am compiling the code in release mode (code generation in Multithreaded DLL, no debug info), with linker settings havine debug info
I build all the code, run the installer - works fine on my system (Windows 2000 sp2, MSVC6 sp5, latest Win32 SDK)
I install the program on another Win2K box - bamm dialog complaining about missing MSVCRTD.dll - this is the debug version of the runtime !!! How can this be ? I run it through dependency checker (the latest version from the website) and get no mention of MSVCRTD.dll? WTF !!! All it shows is MSVCRT.dll links
Argggg!
|
|
|
|
|
use the dependency walker
WUSIWUG
|
|
|
|
|
Are you sure no other DLL dependency (may be loaded explicitly) is Debug build or is dependent of msvcrtd.dll?
C# is fundamentally broken. - Christian Graus
|
|
|
|
|
Well that's what I had hoped the newer version of dependency walker would show - if I open every node I see NO mention of MSVCRTD.dll
However i do see two warnings
APPHELP.dll had this:
Warning: At least one delay-load dependency module was not found.
MPR.dll had this
Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module.
MPR has NO dependencies on MSVCRTD.dll according to dependency walker
|
|
|
|
|
DOH !!! I found it !
What a dumbass - I had changed the name on a dynamic loaded DLL and put the wrong version !! Sh*t !
|
|
|
|
|
Hello:
I was wondering if is possible to display a string in a CStatic control. The purpose of this is to display information. Any answer is more than welcome.
Thanks,
Luis E. Cuadrado
)
|
|
|
|
|
there is 2 ways
1)((CStatic*)GetDlgItem(ResourceId of ur control here))->SetWindowText("Enter your text here") ;
2) make a control variable with classwizard and
your controlvariable.SetWindowText("your text here") ;
this will work....
WUSIWUG
|
|
|
|
|
I don't understand that difficult is that...
Use SetWindowText
May be your question is differente.
Saludos
Best Regards...
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
Hello again:
I tried SetWindowText and it worked. I tryied the 1st way that renjith pointed out and it wasn't working (Maybe I forgot something). Then I tried the second way (Creating the member variable with ClassWizard) and called SetWindowText and it worked.
I know the question sounded very newbie(or stupid), the reason that I asked is because I'm new in MFC and all this Windows 32 API programming stuff. Thanks to this web site, I leanred a lot of stuff.
Thanks for your help guys,
Regards,
Luis E.
PS
Saludos Carlos, gracias por tu ayuda.
Luis E. Cuadrado
)
|
|
|
|
|
You are welcome....
Luis, Bien venido
Cheers
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
I have a #import for msado25.tlb in one file, and the namespace is defined as "ADO" . SO all stuff in this file has to be addressed as ADO::something. Now I had another database class that was referring to the ADO stuff as ADODB::. All was working fine until I rebuilt the project (Rebuild all). Now it told me that it didnt know what ADODB was, and finally I had to put my #import statement in that file as well, plus change all the ADODB's to ADO:: Question is, why in the world was it working fine until I rebuilt all? I cannot explain this!
Any clues?
Thanks,
ns
|
|
|
|
|
Because the file that was using it earlier and was not rebuilt. So it had all the information it needed. Now ith your change when you did a rebuild you created a conflict.
Try and put your import in a single file and make sure that the file is included where ever it is needed rather than making multiple imports of the same library.
|
|
|
|
|
How dangerous is it to have #import twice declared. Its not too clear to me how to get it consolidated to one statement. Ones in an ADOX class, and ones in an ADO class. I really dont see why I should put adox.h into ado.h, but it I'm playing with fire I'll work at this. So really, am I going to get in unexpected trouble here?
Thanks,
ns
|
|
|
|