|
afxloadlibrary doesn't want to compile in my program. I'm writing and MFC app, and if I compile with the line:
hLibrary = AfxLoadLibrary(pathtodll);
I get a compiler error that AfxLoadLibrary is an undeclared identifier. If I use the global namespace, like so:
hLibrary = ::AfxLoadLibrary(pathtodll);
I get the error that AfxLoadLibrary isn't a member of the global namespace. The documentation says that AfxLoadLibrary IS a member of the global namespace, and if you type ::, when VC++ generates that LONG list of functions in the global namespace, AfxLoadLibrary DOES show up on that list. What's the deal? How do I get it working?
Thanks,
augy
|
|
|
|
|
Sounds weird.
Did you try doing a "Rebuild All"? That usually fixes those kind of weird errors.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
|
Hmmm, didn't fix it. The errors were the exact same. Does anybody know what header file afxloadlibrary is declared in?
augy
|
|
|
|
|
afxdll_.h
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
Well, it compiles now, but the linker tells me that afxloadlibrary is an unresolved external. Is name mangling the problem?
augy
|
|
|
|
|
You said your app was an MFC app, but it sounds to me like you have not included afx.h.
Afx.h will automatically include afxdll_.h plus link your app to all the lib files needed.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
this is just a simple c++ question. Ive already got this much of the program written. I just need seats first class seats to be full at 5 and economy at 10. I need it to prompt the user to enter y/n when one is full if the other section is ok. This is what i have so far
#include<iostream.h>
#include<stdlib.h>
int main()
{
void seatedr(int charted);
int plane[10];
int seated;
int firstclass=1;
int economy=6;
seated = 0;
for(int x=1; x<=5; x++)
{
if (plane[x] == 0)
{
plane[x] = 1;
seated = 1;
}
}
for(int i=1; i<=10; i++)
{
cout << endl;
cout << "Please type 1 for First Class" << endl;
cout << "Please Type 2 for Economy" << endl;
cin >> x;
if(x==1)
{
cout << "First Class seat : " << firstclass <
|
|
|
|
|
Your question is quite unclear - and this goes for the code as well.
Let us assume that this is not an assignment question and you are actually trying to learn C++ on your own
Have a class with the seat array as a member. Add functions to set a first- or second class seat, returning true or false depending on if it is possible or not. If the function returns false in your assigment loop, ask and try the other function.
The important thing - try to break the problem down into smaller pieces, think functions, not having one big loop doing it all, you'll never learn programming that way.
|
|
|
|
|
Hello,
As a MFC newbie I am, it is with much frustration and also humbleness that I would like to know from one of you experienced programmers what the hell is going wrong with my program.
It happens that I have several custom controls operating in different dialog boxes (one per each) and in one of these I have a 7 segment (LCD) display outputting a 5 digit (signed) number.
There is no problem whatsoever unless you hover a dialog box over the one that contains the above referred 7 segment display control -- if it is painting at that particular time, it stops with a debug assertion, as, apparently there isn't a valid DC . Just before starting any graphical output, I attach the control's own DC, by means of calling GetDC() , set the viewport up, and at the end of the output, I simply Detach it.
I really don't know what's wrong... so if you could please lend me a hand or two, that would be great. (A finger would be enough, as I would be more than happy to know the direction to take )
Thanks,
David
|
|
|
|
|
|
But Mike, can I ask you to explain me why you should use CPaintDC ? I mean, what is the difference between using CDC or using the handle hDC you get from the PAINTSTRUCT that OnPaint provides you with?
By the way, many thanks for the reply.
David
|
|
|
|
|
Basically, the function BeginPaint which is called by CPaintDC , prepares the DC with clipping regions, background brush, and hides the caret if there is one. See this[^] for more information.
--
Ich bin Joachim von Hassel, und ich bin Pilot der Bundeswehr.
Welle: Erdball - F104-G Starfighter
|
|
|
|
|
Hi,
I have a few questions for you image processing developers out there. I am currently mapping a somewhat distorted (mostly skewed) image into a flat image plane. My Prof. told me to use Affine transformation to solve the problem. I first detect the corners of the parallelogram (distorted image) and use it as my anchors (A, B, C, D). My transformation matrix is:
| a b c |
| d e f |
| 0 0 1 | where a, b, c, d, e and f are matrix coefficents. The two zeros at the bottom means that there is little perpsective distortion so the values are not needed. At first, I tried to calculate the coefficents by simple linear alegbra.
| a b c | |Ax| |Ax'|
| d e f | |Ay| = |Ay'|
| 0 0 1 | |1 | |1 | where the Ax' and Ay' are the coordinates of the newly mapped space. A', B', C' and D' are the corners of the image space I am mapping to.
Since I know Ax, Ay, Ax' and Ay', I thought I would have more than enough information to solve the matrix. I did use that matrix but I starting getting warped images with coordinates off the plane. I realized there could be multiple solutions so I needed to use Least Squares approximation to find the best coefficients. But Least Squares seem to be very difficult to program and I havent found any code to help me.
Does anyone know of an efficient way to solve for the matrix coefficients? Or, if you have a better way to transform the image into another parameter space, please tell me. Any help is appreciated.
Thanks in advance!
Engineer in progress... ~wyoung
|
|
|
|
|
Try looking into some of the code for robocup - many of the issues involved in correcting camera calibrations sound similar to the problems you are having, and there is a fair bit of code already available to solve those types of problems.
Numerical Recipes[^] Is the book you want if need / want to do the maths on your own.
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
Hello guys, I'm looking for information about the AC-3 algorithmus and audio compression in general. Does anyone know any source of information?
Regards,
Alex
Don't try it, just do it!
|
|
|
|
|
Alexander M. wrote:
Don't try it, just do it!
Google does.
http://www.atsc.org/
Bikram Singh
|
|
|
|
|
Hello,
A quick question: Is it alright to use a CWinThread derived class to create a non User-Interface thread?
If it is, would it be okay to initialise AND execute whatever objects (classes) I need inside InitInstance ?
Thanks,
David
|
|
|
|
|
Straight answer: Yes, it is alright. Creating and executing objects in the CWinThread::InitInstance is ok as well.
Detailed:
To create a non-GUI (worker) thread, just create a function that will run on the thread (just like WinMain runs on the primary thread). Then call AfxBeginThread a pass it a pointer to the function. When you wish to end the thread execution, just return from the function.
You should use CWinThread objects only when you have a GUI thread. Although it is safe to use a CWinThread object with a worker thread, it's a waste of resources. Only use a CWinThread object if your new thread requires a message pump. If it doesn't need it, just create a function that executes on the new thread.
For more information, see AfxBeginThread in MSDN.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Straight answer: Yes, it is alright. Creating and executing objects in the CWinThread::InitInstance is ok as well.
But I heard something before....
Although it is safe to use a CWinThread object with a worker thread, it's a waste of resources.
Ahh, I see...
Only use a CWinThread object if your new thread requires a message pump.
Flawless explanation as usual, Antti. I thought there would be some sort of a considerable difference between using or not CWinThread , but I just didn't know what/how.
As usual, you've enlightened and pointed me in the rihgt direction.
Thanks a lot Antti,
David
dNimrod#X
________________________
|
|
|
|
|
This is a question, not a critism of your answer
AfxBeginThread returns a CWinThread pointer. So what is the difference if one uses a CWinThread derived class and simply returns FALSE from the OnInitInstance() function, or one calls AfxBeginThread() with a pointer to a function? Does not AfxBeginThread() end up creating a CWinThread object anyway, so how is one a bigger waste of resources than the other?
I have so far used AfxBeginThread() for small uncomplicated threads, and CWinThread derived classes for more complicated threads where I can group helper functions all within a class structure.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
There are other resources than those used by the code. Deriving, designing and implementing the CWinThread -derived class that is to operate as the GUI thread also takes time, which is a crucial resource in a software project.
As such, doing this process for a thread that wouldn't necessarily require it is a waste of time/resources, even though the impact shouldn't be considerable.
Writing a single function is easier, I think. However, this is more of a point-of-view issue than an actual problem, so let's just agree that both solutions are just as good to use
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Hi!
Is there a way to compile a library into a "static version" so that when you link to an application, it doesn't need an extra DLL?
For example, I would like to compile Ingo A. Kubbilun's code (http://www.codeproject.com/docking/IngoExpBar.asp) so that my application doesn't need the DLL to run properly.
Thks in advance!
Appstmd
http://www.atlence.com
|
|
|
|
|
Yes.
In Visual Studio .Net (2003), create a new Win32 project using the wizards. For Application Type, select "Static Library". Add MFC support if you need to. And off you go.
Not sure if this is possible in VC6. But in VC .Net it is.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Hi,
Every body.
I would like to draw a control which you can find in windows 2000 Perofrmace tab. problem is that I have used a way like drawing into the bitmap and Bitblitting it.
But I don't want to use bitmap. Becuase It take so much of memory.
I tried to directly draw on to dialog box without using bitmap. But I have flickering problem.
Canany one help me out!!!
bye
Salman
Live and Let live
|
|
|
|