|
<br />
_ConnectionPtr* CEGraphApp::GetConn()<br />
{<br />
return &m_pConn;
}<br />
error info:
Compiling...
EGraph.cpp
C:\EGraph\EGraph.cpp(154) : error C2440: 'return' : cannot convert from 'struct _Connection ** ' to 'class _com_ptr_t<class _com_iiid<struct="" _connection,&struct="" __s_guid="" _guid_00000550_0000_0010_8000_00aa006d2ea4=""> > *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
Error executing cl.exe.
amazing...
I think it should be right anyhow.
-- modified at 9:18 Tuesday 6th November, 2007
|
|
|
|
|
if m_pConn is declared with _ConnectionPtr *m_pConn
then your return statement should be : return m_pConn; without the & operator
|
|
|
|
|
Sorry, a typing error
m_pConn is declared as _ConnectionPtr m_pConn
|
|
|
|
|
and what is _ConnectionPtr defined like ?
|
|
|
|
|
It's a type in ADO.
What's in msado15.tlh:
<br />
_COM_SMARTPTR_TYPEDEF(_Connection, __uuidof(_Connection));<br />
I think it's not for reading.
|
|
|
|
|
It is smart pointer, I think you should define function like this:
_ConnectionPtr CEGraphApp::GetConn()
{
return m_pConn;
}
don't use pointers to smart pointers
rrrado
|
|
|
|
|
It is ok. I suppose returning a pointer is more efficient.
|
|
|
|
|
I'ts against COM philosophy. You are giving away reference to object without incrementing reference count. Any query you execute on that connection is 1000x slower than creating new smart pointer which calls AddRef and Release on destruction.
rrrado
|
|
|
|
|
Hello All,
I prepared a SDI application by using MFC and Directx 3D now i have to add functionality of print.
for that i am using print command which is default provided by editor it shows print diaolog and command fire to the printer also but i am not getting any contents or picture printed out. printer out a blank paper.
can anybody tell me what i have to do for taking printout of which is shown into the view area of my application.
thanks
Bankey
|
|
|
|
|
Have you had a look through the C++ / MFC Printing article section here on Code Project?
|
|
|
|
|
The principles are "simple", get a DC to the printer device and send the datas to it like you make with your View.
The things complicate themselves a bit because the every printer is different (I mean that it is quite easy to get output to the screen, but to ensure the output to any printer... could be hard work).
I guess that you are missing to do things in Device-Independant mode and/or missing the correct MAPMODE.
Take a look in the articles of the printing section (I personally like articles from Roger Allen and Joseph M. Newcomer)
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Hello,
i am trying to attach an dialog to Document/View application? but i
cannt,
how can i attach the dialog to the Document? is there a way?
thanks
|
|
|
|
|
What do you mean by attach ?
|
|
|
|
|
Hello,
by default, I want My dialog to be displayed in the place of the view,
i never done it before, that is why i used the word "attach".
Is it possible to do?
thanks
|
|
|
|
|
Dialog in Dialog is support by MS.
Dialog in a View seems not supported by MS.
You can make a copy from the dlg to the view, that's totally possible.
|
|
|
|
|
Are you wanting to have a CFormView ?
|
|
|
|
|
I dont know what is CFormView, so, i dont know what u mean, could u explain me? thanks
|
|
|
|
|
CFormView is a CView derived class that has CDialog aspect, you can use it like a Dialog in your resources adding controls like EditBoxes, Buttons... The big difference is that CFormView has almost all the Doc-View relations by default and you don't have to complicate yourself replacing a view with a dialog.
I suggest you to create a new Project, in the last step of wizard select CFormView as the base class for your CMyAppView and make test on your own. You can always ask when you stuck in something.
Take a look in your documentation to read what CFormView is would not be a bad idea as well.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Gofur Halmurat wrote: by default, I want My dialog to be displayed in the place of the view
The default window is created and shown in the CWinApp::InitInstance method which the Wizard creates and sets up for you. Just go in there an change it to do whatever you want.
|
|
|
|
|
using LoadImage(...)function, i can load a little size bmp file from disk, but the function dosn't work when i load a big size (32M) bmp file. is there size limit for loading an image from file?
thanks
|
|
|
|
|
I think there isn't such a constraint. I suggest you to check GetLastError return value.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Hi
I have some project written in VC++ 6.0 edition. Now I have VC++ 2005 express edition. I couldn't open old VC++ 6.0 project into VC++ 2005 express edition. I am new to VC++ 2005 edition.
It may be silly question but I am getting hard time to open it.
Is there anybody who can help by telling me the steps requires to open VC++ 6.0 project into VC++ 2005 express edition.
Thank you.
|
|
|
|
|
Which kind of project was it ? If it was an MFC project, then forget about it because the MFC's are not included in the Express edition.
Otherwise, you just have to open the dsw file and VC2005 will start a conversion wizard.
|
|
|
|
|
HI
It was an application developed by MFC AppWizard(exe). Is has .dsw file. It click the .dsw file and it converted to VC++ 2005 file format but while tring to build it gives me error, some included file (ex: afxwin) not found.
Thank you.
|
|
|
|
|
Was that a question ??
If you want to develop MFC apps, you'll need to buy the Enterprise edition.
|
|
|
|