|
This is from MSDN Library:
If the error message occurs on a symbol immediately following a typedef'd variable, ensure that the variable has been defined somewhere in the source code.
Rickard Andersson8
Here is my card, contact me later!
UIN: 50302279
E-Mail: nikado@pc.nu
Interests: C++, ADO, SQL, Winsock, 0s and 1s
|
|
|
|
|
That does seem to apply to my situation as if I don't specify
a capacity i get no syntax error.
<br />
...<br />
typedef std::vector<myClass> myClassVector;<br />
...<br />
myClassVector mcv;
|
|
|
|
|
have you tried
mcv.reserve(100);
Gary Kirkham
A working Program is one that has only unobserved bugs
I thought I wanted a career, turns out I just wanted paychecks
|
|
|
|
|
I have a DLL class that I am exporting,
// Observer Class
class APA_API CStateObserver
{
...
}
class APA_API CStateMachine
{
public:
void PushObserver(CStateObserver * inpObserver);
private:
std::deque<cstateobserver*> m_dqObservers;
}
APA_API is the define that resolves to the correct __dellspec(lalalalalal) etc...
I get this compiler warning message,
warning C4251: 'm_dqObservers' : class 'std::deque<class cstateobserver="" *,class="" std::allocator<class="" *=""> >' needs to have dll-interface to be used by clients of class 'CStateMac
I have 'Warnings as Errors' set so this warning is a real problem.
What are my options?
Cheers
Asim Hussain
e: asim@jawache.net
w: www.jawache.net
|
|
|
|
|
Did you include the header for the deque container?
Kuphryn
|
|
|
|
|
disable it - I think this is one of the ones you can safely ignore (like warning 4786 about long names)
Also make sure you don't expose it directly, such as
class Foo {
public:
map<int,int> & getTheIntMap() {
return m_map;
}
private:
map<int,int> m_map;
}
exposing it like so will cause you all sorts of problems - just don't go there.
Wrap all access to the collection with functions for adding and removing, which it appears you are doing anyways.
Also you might consider using STLPort - which may give you fewer headaches
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
|
|
|
|
|
Would you tell me what API support to recognize CD-ROM status when i push the button eject on CD-ROM. Example it can recognize there are CD in CD-ROM or not.
|
|
|
|
|
Specifically I get "LINK : fatal error LNK1561: entry point must be defined"
I searched MSDN and with Google but no luck. Did this happen to anyone else? How did you get it to build?
Cathy
Life's uncertain, have dessert first!
|
|
|
|
|
Generally speaking, a DLL wants a function called DllMain as its default entry point. Do some MSDN searches on DllMain and you should see lots of stuff. There is a sample called DllHusk that is somewhat illustrative.
The Ten Commandments For C Programmers
|
|
|
|
|
Thanks! It turns out it was a typo in the include directory listing. I had accidentally deleted the period in front of \
Cathy
Life's uncertain, have dessert first!
|
|
|
|
|
check for _USRDLL being defined. See if subsystem is windows. Do you have any weird linker customizations? Just a thought (I actually don't have VC7 so I may be completely off base )
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
|
|
|
|
|
Thanks! It turns out it was a typo in the include directory listing. I had accidentally deleted the period in front of \
So yes I guess I had a pretty weird linker customization goin on.
Cathy
Life's uncertain, have dessert first!
|
|
|
|
|
Hi. I want to call one method, which i have declared in a Dialog´s Class from other class. So, in the second class i have a varible CDialog* pWnd; which is initialized by SetParent(CDialog *p) . Then, in the dialog I call secondclass.SetParent(this) . then i add the #include "mydlg.h" in seconclass.cpp
All that work fine. However, when i try to use any dialogclass's method in secondclass as ((CmyDlg*)pWnd)->NuevaTarea(strRecvd); doesn´t work
But when i compile this message appear : error C2065: 'IDD_SPOOLERSUR_DIALOG' : undeclared identifier
error C2057: expected constant expression
(SpoolerSur is my Cdialog class)
el hombre arriesga su vida cada vez que elige y eso es lo que lo hace libre
|
|
|
|
|
Martin_Viet wrote:
then i add the #include "mydlg.h" in seconclass.cpp
But when i compile this message appear : error C2065: 'IDD_SPOOLERSUR_DIALOG' : undeclared identifier
error C2057: expected constant expression
You also need to include the "resource.h" file in secondclass.cpp
Max..
Maximilien Lincourt
For success one must aquire one's self
|
|
|
|
|
Max : i included the Resource.h but it appear the same error
el hombre arriesga su vida cada vez que elige y eso es lo que lo hace libre
|
|
|
|
|
|
i´d solved the problem. i need to include the Application header file("MyAppl.h")
el hombre arriesga su vida cada vez que elige y eso es lo que lo hace libre
|
|
|
|
|
How to send message from VC7 to IE6 ??? (eg. select internet page)
|
|
|
|
|
One solution is FindWindow() and SendMessage().
Kuphryn
|
|
|
|
|
To open a page you can use ShellExecute()
el hombre arriesga su vida cada vez que elige y eso es lo que lo hace libre
|
|
|
|
|
Hi,
Is there a way to execute a MFC app with an arguments? I would like to do something like:
Get a Filename and Filepath from a database. Launch the app with that file loaded.
Thanks for helping.
Regards
Everything's beautiful if you look at it long enough...
|
|
|
|
|
Check CCommandLineInfo or, if you want to do the things as in console programs, use __argc and __argv .
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
also you can customize CCommandLineInfo with your own derived class and then pull arguments out as you need them.
You can do some nifty things this way.
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
|
|
|
|
|
have an app which, upon starting, creates a splitter window. One of the two panes (call it the one on the right) is simply a CFrameWnd. However, at a later time (specifically when the user clicks on something in the left pane), the CFrameWnd in the right pane is supposed to be used to house a CFormView. The initialization code (ie. the code to setup the new right pane) is called from within the left pane's code. Now, the form view shows up just fine; however, I don't seem to be receiving any events. For example, if I click on an edit box, it never receives the focus. If I click anywhere on the form, it doesn't receive the event, etc. I don't know if it matters if the CEdit controls are created dynamically on the form view or not...I did something similar to this before, but for some reason, this time around I'm not getting any events.
The form view itself is setup/created in a separate COM object. So, the calling code (from the left pane) is basically:
iCOMObj->initView(pParent); // pParent is the right pane's frame
pParent->SetActiveView(...);
pParent->RecalcLayout();
and within the actual COM DLL (ie. the initView method):
// since the COM object is a derivative of CFormView, we call
// Create (using pParent as its parent) to set this up
Create(...);
ShowWindow(SW_SHOW);
SetDlgCtrlID(AFX_IDW_PANE_FIRST);
...now, I'm not sure if this is the right way to do it, but the form does show up. It's just the messages that don't seem to be trapped. Is there a correct "order" to do this kind of thing in, given that the actual form is in a separate DLL?
Any suggestions/help? Thanks a bunch guys!
|
|
|
|
|
Well,
I can vaguely remember having had a similiar problem.
In fact it was the creation of the view by itself. Create tells the child who is the parent, but the parent will never know, that it has childs. In this case the parent must do the creation of the view.
I think a pParent->CreateView(...) will help in this case.
Then the view is created by the parent, while otherwise the child is attached to the parent.
For the needed values to use CreateView, please have a look at the documentation. As far as I can remember this works only for CFrameWnd and its derivates.
G. Steudtel
|
|
|
|