|
Roger Allen wrote:
So, do I have to make my library also have a DLL which both the APP and DLL link against to make sure I only get one copy of the object, or is there another way around this?
Yep, your static object exists in both executables (.exe and .dll).
You can switch to .dll. You can also create different integration model (from the class names I guess you're creating some plugin framework.) which uses/knows of plugin map only in .exe or main .dll.
Tomasz Sowinski -- http://www.shooltz.com
To some its a six-pack, to me it's a support group
|
|
|
|
|
Cheers Tomasz, it was late last night when I encountered the problem and didn;t really have the time or the inclination to look further into it just then. THanks for clarifying my thoughts.
Tomasz Sowinski wrote:
from the class names I guess you're creating some plugin framework
Yes, thats exactly what I am doing.
Roger Allen
Sonork 100.10016
I think I need a new quote, I am on the prowl, so look out for a soft cute furry looking animal, which is really a Hippo in disguise. Its probably me.
|
|
|
|
|
I have created a statically linked VS6 application that runs on a CD-ROM that will search and display encrypted data from that CD. It has to be a self-contained app with no dependencies ie run anywhere from any CD, this is working fine in a single cd state.
But the client wants multi-cd capability for future growth and when searching from the 1st CD everything again is fine, but when searching for data on the second CD, W2K throws up a dlg with this msg 'The wrong volume is in the drive. Please insert volume [Name of CD] into drive R:.'. After clicking any button I get this message 'The instruction at "0x00439558" referenced memory at "0x00439558". The required data was not placed into memory because of an I/O error status of "0xc0000012"'.
On Win95 I just get the blue screen (cannot read CD) only!
Any ideas on how to resolve this (I have attached remotely to a debug version and stepped through the code, still no wiser)??
SR
|
|
|
|
|
When you say "multi-cd" here, I assume you are talking about multiple CD's and only one CD-ROM drive. Your problem seems to indicate this.
First you have to understand how loading and running programs is handled on NT. Then you apply the linker switch
/SWAPRUN:CD
Now your binary image (the program) is available even after you remove the mentioned CD.
If you also want to "help" the user by ejecting the wrong CD and ask for the correct volume, you can have a look at Q165721.
|
|
|
|
|
Hello,
I have created (in code, not the wizard) an array of CEdit boxes. I would like to be notified when the user has clicked in one of these boxes (and which box they clicked in). How would I get MFC to send me a message?
thanks!
JennyP
|
|
|
|
|
IDC_EDIT1 - IDC_EDITn are in range
ON_CONTROL_RANGE(BN_CLICKED, IDC_EDIT1, IDC_EDITn, OnEditRangeClick )
afx_msg void OnEditRangeClick(UINT uID)
ÿVOTD:19 "My dear brothers, take note of this: Everyone should be quick to listen, slow to speak and slow to become angry, 20for man's anger does not bring about the righteous life that God desires." - Jam 1:19
|
|
|
|
|
Thanks for the reply...
So in my code, the "IDC_EDIT1" would be the 2200 (the control's nID)?
m_CEAvailable[i].Create(EditStyle | WS_TABSTOP, CERect, this, 2200+i);
JennyP
|
|
|
|
|
Yes! but I would advise you to define IDC_EDIT1 (or whatever the name you like) and use it instead, cleaner!
I am in YYY
|
|
|
|
|
Hello,
I would like for my report-mode list control to do the following:
* Have text-wrapping on one line so that it's taller than a regular one-line item.
* Change the font (not just color) of each item and further, each sub-item.
Any suggestions or pointers to where to search? I've searched the MSDN somewhat and haven't found anything obvious.
Thanks!
JennyP
|
|
|
|
|
Look in the MSDN Library for "custom draw" in the sections on the Common Controls. In the October 2001 edition, it's under Platform SDK Documentation \ User Interface Services \ Windows Common Controls \ Custom Draw Controls.
Gary R. Wheeler
|
|
|
|
|
I have been playing around with ICopyHook, and have made a Shell Extension which implement ICopyHook, and it works perfect
The only problem is that ICopyHook only works with printers and folders. Is there any way to make something similar for files...
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
My problem is:
I´m trying to replace my file name from the CString wich value is "C:\esContaX\Archivos\TblPols.dbf" to finish with something like this: "C:\esContaX\Archivos\" using the following code: m_strAppPath.TrimRight('\'); , but I get the following errors:
--------------------Configuration: esContaX - Win32 Debug--------------------
Compiling...
esContaX.cpp
C:\esContaX\esContaX.cpp(230) : error C2001: newline in constant
C:\esContaX\esContaX.cpp(232) : error C2143: syntax error : missing ')' before 'return'
C:\esContaX\esContaX.cpp(232) : warning C4305: 'argument' : truncation from 'const int' to 'char'
C:\esContaX\esContaX.cpp(232) : warning C4309: 'argument' : truncation of constant value
Error executing cl.exe.
esContaX.exe - 2 error(s), 2 warning(s)
Can somebody help me showing me how can I acomplish this.
|
|
|
|
|
|
"\" is an escape character in C-strings. Like "\n" for newline. Just double up the "\" to get a "\".
"C:\\esContaX\\Archivos\\TblPols.dbf"
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
|
|
|
|
|
Ok this is the complete code
CString strSection = "Files";
CString strStringItem = "DataFiles";
m_strAppPath= theApp.GetProfileString(strSection, strStringItem);
// the value of m_strAppPath Now is = C:\esContaX\Archivos\TblPols.dbf
TRACE(m_strAppPath.GetBuffer(m_strAppPath.GetLength()));
//so trace shows C:\esContaX\Archivos\TblPols.dbf
m_strAppPath.TrimRight('\\');
TRACE(m_strAppPath.GetBuffer(m_strAppPath.GetLength()));
//Now trace shows the same value C:\esContaX\Archivos\TblPols.dbf
return TRUE;
|
|
|
|
|
TrimRight would trim only from Right and the first character found is 'f', so it cannot remove any '\' character. but if your path was: "C:\esContaX\Archivos\TblPols.dbf\", it would remove it!
Hope that helps!
ÿVOTD:19 "My dear brothers, take note of this: Everyone should be quick to listen, slow to speak and slow to become angry, 20for man's anger does not bring about the righteous life that God desires." - Jam 1:19
|
|
|
|
|
My release version is running fine with this:
xDontCare = "dontcare";
for (char* pc = xDontCare ; *pc ; pc++)
*pc ^= 0x30;
my debug version is crashing at the xor line. Why and how can I get past it? I rebuilt the project totally in debug version as well as release and its the xor....
help!
ns
|
|
|
|
|
Don't try to modify read only memory. This is an undefined operation.
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
|
|
|
|
|
Which part is read only memoery? Sorry to be so sense. how would you do it?
Thanks,
ns
|
|
|
|
|
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.
|
|
|
|