|
Its what I had been trying to do to include support for a simple access db. i had the order of the #include and #import reversed, so wasted several hours debugging the errors I got. I thought I was missing something and needed more files to include or something. Thanks so much for the response,
ns
|
|
|
|
|
I only have these files in my added class in an MFC project:
#import "C:\\Program Files\\Common Files\\SYSTEM\\ADO\\msado15.dll" \
no_namespace \
rename( "EOF", "adoEOF" )
#include "stdafx.h"
#include <ole2.h>
I get the compile error (for my added class:
c:\program files\microsoft visual studio\vc98\mfc\include\afxv_w32.h(14) : fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h>
What is missing or extra ?
Thanks,
ns
|
|
|
|
|
Move import line after
#include "stdafx.h"
|
|
|
|
|
Thanks so much! That worked!
ns
|
|
|
|
|
Hi again,
I've been asked to write a simple ftp client, usually that would be easy enough with wininet but for this it needs to be able to perform server to server transfers. Its for a system we're trying to implement for backing up our work. I know of FXP but how would I go about doing this in an MFC program? Its a bit daunting to be honest but we really need to get it done soon. Or even better if anyone knows of a library out there that has the features of being able to make server to server transfers, life would be great
Thanks
|
|
|
|
|
i intend to develop a software to manage my private files.
when this software is running, no "save" or "edit" commands will
be allowed in the MS office (word, excel...). Now i
am wondering whether there has already been some software
like this, or, if not, can anyone give me some hints?
(now i can use my program to capture the windows messages,
like WM_SIZE, WM_CLOSE in another program, but not
the "save" command.)
can i use API hooking to do this?
|
|
|
|
|
I have:
char* tempImage = (char *) (_bstr_t) pRecordset->Fields->GetItem ("pImage")->Value;
The stuff stored in Value is a pointer to data gotten out of a bmp (so its binary right? )
So should I be doing char*?
Not sure.
Also how to get the size of the image stored in Value? Strlen would count upto the first embedded Null, of which there are plenty in the binary data. So, what function to read the size?
Thanks,
ns
|
|
|
|
|
The safer way would be checking the Value.vt and verify the Variant type you are receiving. Prolly a SAFEARRAY of BYTE or a BSTR; in this case, I would not use char *, I would use LPCTSTR indeed.
Concussus surgo.
When struck I rise.
|
|
|
|
|
The safer way would be checking the Value.vt and verify the Variant type you are receiving. Prolly a SAFEARRAY of BYTE or a BSTR; in this case, I would not use char *, I would use LPCTSTR indeed. The _bstr_t or SAFEARRAY manipulation classes and APIs have methods for safely determining the length.
Concussus surgo.
When struck I rise.
|
|
|
|
|
Hi,
I would like detect when I execute an application (exe) if exist. Ok for that part I finding the code.
Now I would like if the EXE exist active the window.
Best Regards
youssef
|
|
|
|
|
how to use valarray.
i get many errors from #include<valarray>
|
|
|
|
|
hi,
i have lots of drawing to be done with all tha data in the doc.after initialising the starting point and various other params,i draw it throught the view in ondraw like
pDocument->Draw(pDC)
because the drawing takes all params present in the doc itself.
Now,i need to draw the diagram right when a new scrollview is created and i follow all the regular steps like setting the map mode etc just like the scribble example.
The problem is,the view created on startup has the diagram but the new one created from Ctrl+N fails and takes me to scrollview source's line that checks if the mapping mode in MM_NONE.
Why.If the first one drew all the others should!I am stuck;help
Carlos
|
|
|
|
|
Is this a SDI or MDI application? If MDI (that's what I guess), your new doc is blank!
Do you need to share the same document between documents object? then why having separate docs objects. Do you know you may have many views attached to a single document? is it what you are trying to accomplish here?
You may call UpdateAllViews(...) to force redraw of your views, use lHint if you want to indicate which part (object) need to be invalidated.
As my daughter would say, "... Whatever!"
|
|
|
|
|
hi ernsest
my sw deals with with system designing so there has to be many diagrams which are finally connected to a main one.For this i have ot have different documents and with that different views.
As i said,the view created on startup is fine but not the new ones.
(i have now come to the gui part of my sw and am testing.Actually,no views should be on startup but created only when required with a project;when Ctrl+N dosent work i guess the views created on demand too will not work)
carlos
|
|
|
|
|
In a non MFC app theres a try-catch thing like:
catch ( _com_error &e )
{
_bstr_t bstrSource (e.Source());
_bstr_t bstrDescription (e.Description());
TRACE ( "Exception thrown for classes generated by #import" );
TRACE ( "\tCode = %08lx\n", e.Error ());
TRACE ( "\tCode meaning = %s\n", e.ErrorMessage ());
TRACE ( "\tSource = %s\n", (LPCTSTR) bstrSource);
TRACE ( "\tDescription = %s\n", (LPCTSTR) bstrDescription);
AfxMessageBox ((LPCTSTR) bstrDescription);
}
catch (...)
{
TRACE ( "*** Unhandled Exception ***" );
}
I am using this code in an MFC app, in a new class that I am making. When I compiled I got the error:
c:\program files\microsoft visual studio\vc98\mfc\include\afxv_w32.h(14) : fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h>
When I looked this up in MSDN , I see
Fatal Error C1189
#error : user supplied error message
This error message is generated when there is an #error directive in the program. For example:
#undef _WIN32
#if !defined(_WIN32)
#error _WIN32 must be defined //error
#endif
int main() {
return 0;
}
I only have #include "stdafx.h" in my new projects class .h file.
What can I do about this error?
Thanks,
ns
|
|
|
|
|
#import "C:\\Program Files\\Common Files\\SYSTEM\\ADO\\msado15.dll" \
no_namespace \
rename( "EOF", "adoEOF" )
#include "stdafx.h"
#include <ole2.h>
This error started happening when I included #include "stdafx.h", but without it it didnt know what CString was.
These are two standalone .cpp and .h files and I havent instantaited them anywhere in the main MFC project, so theres no #include "myClass.h" except in myClass.cpp.
Does this clarify matters?
Please answer. I am very puzzled!
|
|
|
|
|
In project settings I had to set:"automatic use of precompiled headers", because without that I got the error "unexpected end of file found while loooking for precompiled header directive".
Is this relevant?
Thank you,
ns
|
|
|
|
|
There is a function setautourldetect suporrted by CRichEditCtrl as per MSDN but when actually called there is no such function in the header file . there is a compiltion error can anybody help me ?????
|
|
|
|
|
In January 2001 MSDN is no such function by CRichEditCtrl. Maybe it's something added in the latest Platform SDK?
Sonork 100.15206;PavelK
|
|
|
|
|
|
I think there is a macro for this in ATL but you may want to send the message
SendMessage(
(HWND) hWnd, // handle to destination window
EM_AUTOURLDETECT, // message to send
(WPARAM) wParam, // URL detection state
(LPARAM) lParam // not used; must be zero
);
Parameters
wParam
Specify TRUE to enable automatic URL detection or FALSE to disable it.
lParam
This parameter is not used; it must be zero.
As my daughter would say, "... Whatever!"
|
|
|
|
|
There is a function setautourldetect suporrted by CRichEditCtrl as per MSDN but when actually called there is no such function in the header file . there is a compiltion error can anybody help me ?????
|
|
|
|
|
Hello;
I have trouble with CSplitterWnd and views. I have working on multiple view with CSplitterWnd sample. But i couldn't found a way to communicating views with each other. How can i set a property of an object on the other view from active view?
Thanks...
|
|
|
|
|
The member function CWnd* GetPane( int row, int col ) which returns window pointer to the window/view in specified pane can be of use.
Sonork 100.15206;PavelK
|
|
|
|
|
I have developed a chat server. In that I am displaying online/offline user list using tree control, I can see the list in all other systems except my DELL laptop which has XP Pro. Sometimes its showing 2 or 3 users including me...and sometimes its not showing a single user...I dont know whats happening. May be there will be some settings for DELL with XP Pro which I dont know. If somebody knows abt it please tell me.
Thanks
Prateeti
|
|
|
|