|
No time for guessing, but I will fix it for you if you send me the project (mail@BartoszBien.com). Discretion assured.
Regards,
BB
|
|
|
|
|
You are very kind, Bartosz, and it will probably be my second away from the last option. But it's not like me to off-load my problem on someone else, and look upon that as a solution.
Sometimes just mentioning a word "en passant" will turn a light bulb on in my head, and something I may not have thought of, or considered before, suddenly becomes inspirational! Revelation! That's how I believe I'll get this thing solved.
ITM, any idea you may have, is certainly very welcome to hear, and when I have achieved a real solution, be assured it will be revealed.
Thanks anyhow. I appreciate the gesture!!
William
Fortes in fide et opere!
|
|
|
|
|
I see your point , however it would be easier for me to check the code myself than to guess blindly what to ask you about. Anyway, is your workspace single-project? I.e., is the resource.h that defines IDD_YOUR_DIALOG the only resource.h file in the workspace? Is it actually included? Try adding #error preprocessor command or something alike to see if it is. If it is not - it should not be hard to check why.
Regards,
BB
|
|
|
|
|
Yes, the project is the only one occupying the workspace, and yes, I only have one "resource.h" included in that workspace (that was one of the things I checked out when I began seeing how stubborn and difficult it was to associate the error with the program code).
As mentioned in an earlier reply, I have not seen anything awry (or suspicious) with the ClassWizard file either.
Thanks. I appreciate the input.
William
Fortes in fide et opere!
|
|
|
|
|
Thanks. I appreciate the input.
So - have you checked if resource.h is actually included?
Try some local usage:
UINT myID = IDD_MY_DIALOG;
Does it still report undeclared identifier?
Regards,
BB
|
|
|
|
|
Hello Bartosz, thanks for your reply. It started a change in events!!
In answer to your question whether I had checked if "resource.h" had been physically included in the program, the answer is, "yes". AAMOF, I believe that was one of my earlier replies to "Vivek Rajan". It was a valid question and it deserved a straight answer. Unfortunately, it's inclusion didn't prevent the error from occurring. (It was included from the birth of the program and remained there ever since. It was never removed.)
With regards to the solution, I tried your last suggestion about inserting a new declaration of the same variable to see if that would help; it didn't. The compiler produced about nine new error messages as a result of having a local variable using the same name. (Of course, I first commented out the line where the original variable was located, so as not to have duplicates declarations.)
Then I started a couple more experiments: I thought to myself, how about using a totally different name altogether (just rename every place where the original dialog name occurred with the new name, including inside the Resource editor, and the "resource.h" file)!
This is where the juice began flowing, because if I were to do that, it means I would be removing all references to the old name! OK! Then let see where all references to the old name appear. That was when I commented out the ("enum") line that AppWizard had inserted for me at the creation of the program, compiled it, and naturally it produced its own new set of complaints about what I had just done.
Great! I uncommented the line and compiled it again to see if I still had stability (viz. getting back the same old error about "undeclared identifier"). To my GREATEST ASTONISHMENT, the program compiled and linked WITHOUT ANY ERROR!!! (I stared at the screen for about a good 10 seconds not knowing if what I was seeing was true. I recompiled the program again, and again it compiled and linked without any error!!) Go figure!
Shortly afterwards, subconsciously I found myself singing, "At last, my love has come along. My lonely days are over, and life is like a song!!!"
Like Shakespeare said, "All's well that ends well!!!"
I think I'll continue singing that little song a bit longer!
Thanks for all your input! They proved to be meaningful.
William
Fortes in fide et opere!
|
|
|
|
|
Congratulations!
Well, I haven't done much, but thanks anyway.
Do you know - some say: "All is well that ends."
Regards,
BB
|
|
|
|
|
Not necessarily true about "All's well than ends," because for those things that are "good," you DON'T WANT them to end, and when they do, that's NEITHER good NOR well.
BTW, my birthdate is also in October (just a few days earlier than yours). More fascinating however, are some of the same things you described in your online profile that I also share interest in, such as Artificial Intelligence (for years), and lately, Neural Networks.
William
Fortes in fide et opere!
|
|
|
|
|
These are called secrets of astrology...
Let the good stars always lead our compilers to happy endings.
Regards,
BB
|
|
|
|
|
Hi, everyone!
I have used Google to search the tutorial about
how to write a lib and dll using VC. There are
really a lot of them. Some of them are too simple
and out of date.
My purpose is to get an one of the bese the tutorials
of this topic. I want to learn how to write a dll/lib
efficiently and safely. And how to use a dll/lib efficiently
and safely.
Now, what is the best tutorials that I can refer?
Thanks in advance,
George
|
|
|
|
|
Hi everybody,
I have a number of .cpp and .h files. Each couple of them(.cpp and the corresponding .h) is compiled correctly. The application compiles successfully, but in the link process an error occurs.
The error is:
main.obj : error LNK2001: unresolved external symbol "public: __thiscall AssociationList<class member,class="" book="">::AssociationList<class member,class="" book="">(void)" (??0?$AssociationList@VMember@@VBook@@@@QAE@XZ)
Could anyone tell me what is all about?
P.S If necessary please tell me to send over the code.
Regards,
grscot
|
|
|
|
|
Could you post the header where this function is declared and the .cpp file file? Just the relevant parts though, including the preprocessor directives. That might be helpful.
AssociationList::AssociationList(void)
// Afterall I realized that even my comment lines have bugs
|
|
|
|
|
Did you put a ";" (semicolon) after the last parenthesis?
Also, did you defined the constructor in the ".cpp" file?
William
Fortes in fide et opere!
|
|
|
|
|
Hi:
I am looking for a way to pass an array of variable-length strings (which is a SAFEARRAY) to a C++ DLL. Eventually, I would like to convert the strings to char* in C++.
Thank you for your help.
|
|
|
|
|
A code snippet,
void FromOleSafeArray(SAFEARRAY *pSA)
{
long nbElems = 0;
::SafeArrayGetUBound(pSA, 1, &nbElems);
BSTR HUGEP *pbstr = NULL;
::SafeArrayAccessData(pSA, (void HUGEP**)&pbstr);
for (long i=0; i<nbElems; i++)
{
CString s;
s.FromBSTR( pbstr[i] );
...
}
::SafeArrayUnaccessData(pSA);
}
void CString::FromBSTR(BSTR str)
{
if (str==NULL)
{
Empty();
return;
}
long nLen = ::SysStringLen(str);
if (nLen==0)
{
Empty();
return;
}
SetLength(nLen);
LPOLESTR wszTag = str;
int iBytes = ::WideCharToMultiByte(CP_ACP, 0,
wszTag, nLen,
GetData(), nLen, NULL, NULL);
}
|
|
|
|
|
Thank you for your sniplet.
I would like to stay away from using MFC. Is there a potential workaround? Maybe byte array?
|
|
|
|
|
I am not using MFC actually. The CString class is my own class wrapper, and I have only pasted one method implementation from CString to show how charset conversion is done. But virtually all the code is flat WIN32.
|
|
|
|
|
I search to read and view the files thumbnail like windows explorer ... Can you help me?
Thierry
|
|
|
|
|
The windows explorer uses a list view with large icons style, then create the thumbnails of the images and store it in the images list attached to the list view. Therefore all you hsould do is to have a list view, iterate the files in a directory and for each file create its thumbnail and add it to the list view's image list. The Explorer cache the thumbnails for better performance in a file called thumbs.db, I think it contain serialized imagelist in addition to folder modification flags.
|
|
|
|
|
Take a look at c:\winnt\folder.htt
|
|
|
|
|
Hi people
i've got a problem with a project i'm working on. basically its meant to display a new jpeg every time i select a different one from a list box.
If i select one, it loads, but i have to move the window for it to display. then if i click a different jpeg, i have to minimise and open it again to see the new image...
i know there's probally a basic awnser to this, like sending a WM_PAINT to the main dialog window, but i just cant get it to work.
any help would be greatly appreciated...
Oh, and its an all win32 program, no wizard or MFC
thanks
-Mortis
|
|
|
|
|
Call RedrawWindow() to make a window repaint. Use the RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE flags to make it repaint right away.
--Mike--
Yeah, payin' the bills with my mad programming skillz.
Defraggin' my hard drive for thrills.
Homepage | RightClick-Encrypt | 1ClickPicGrabber
"You have Erica on the brain" - Jon Sagara to me
|
|
|
|
|
thanks dude
works fine now
|
|
|
|
|
Quick question concerning 1-D vs. 2-D arrays.
Can anyone comment on whether it is faster to address a 2-D
array versus a loooong 1-D array (or vice versa).
Is there any performance difference at all?
|
|
|
|
|
To the compiler, the following both occupy 27 bytes of memory:
char x[27];<br />
char y[3][9];<br />
<br />
int n;<br />
for (int i = 0; i < 3; i++)<br />
{<br />
n = i * 9;<br />
printf("%s\n", x[n]);<br />
}
versus
for (int i = 0; i < 3; i++)<br />
printf("%s\n", y[i]);
Once the address is known, accessing the individual bytes of each variable requires the same amount of time. What does take more time is the calculation in the first example.
|
|
|
|