|
I dont know if I did the equivalent. I did this and it compiled with no errors, just a minute ago.
1. Project
2. Settings
3. C/C++ tab
4. Change Settings For to All Configurations
5. Preprocessor Defintions add: HAVE_REMOTE
6. OK
I now have to figure out why the dll when called is crashing the app. At least I can start working on the code again, that was rather annoying to deal with, indeed. I will try to do it your way to see if that makes a difference at run time. I appreciate the help a lot, I might come back once I get a handle on this dll and actually start coding something. I will most likely have questions. haha
Anyway, I guess this is solved. Thanks again
best regards
|
|
|
|
|
borono wrote: I dont know if I did the equivalent.
There is no difference, they will both do the same thing
|
|
|
|
|
Hi Nish,
I was visiting your site recently and about the method of showing a message box after the main window is closed on an mfc app, i have 2 alternatives. (I decided to contact you here)
1) Removing the WM_QUIT message from the queue after dlg.DoModal() returns.
2) Calling AfxOleLockApp() at the beginning of InitInstance and then calling AfxOleUnlockApp() and AfxPostQuitMessage(0) when i really have to quit.
Best regards and great articles you have,
Mauro Leggieri.
-- modified at 4:45 Sunday 2nd April, 2006
|
|
|
|
|
Mauro Leggieri wrote: i have 2 alternatives. (I decided to contact you here)
How about contacting him directly? or Posting the question in related forum.
http://www.voidnish.com/ContactMe.aspx[^]
Got Signature?
|
|
|
|
|
Hi,
He wrote in his site to contact him by email or any can found him on codeproject's lounge and I was unsure if I post the message in other forum he would see it.
It was a simple choice and my intention was not to offend anyone.
Best regards, Mauro.
|
|
|
|
|
Is this shot priceless or what?
Young Nish
and cool Window Sizer app - I was looking for something like that for making consistently sized screencasts.
Montreal great Guy Lafleur, quoted by CBC on being mugged while vacationing recently in Buenos Aires: "I didn't have any time to react before I got a sucker-punch in the eye. It was like one of the players from the Bruins."
|
|
|
|
|
Hi!
I have got a dialog application that incorporates an openGL Window. When I call an AfxMessageBox my whole application just stalls when it is supposed to come up. Does anyone know why that would be? I am just using the normal command
AfxMessageBox("Errormessage");
Thanks in advance!
|
|
|
|
|
Its because AfxMessageBox creates a model dialog box, which is supposed to prevent interaction with application. I you want to be able to interact with application while a dialog is being showed look for modeless dialog in msdn.
-Saurabh
|
|
|
|
|
Oh but the message box does not even show up! Or could it be that I just can't see it, but don't think so. I tried the message box in another dialg application (which is a lot simpler though) and it works fine there. Very strange!!
|
|
|
|
|
are you sure line containing AfxMessageBox is being executed. can you try to put a breakpoint at that line, run in debugging mode, and see if control reaches that line.
-Saurabh
|
|
|
|
|
hi,
please help me, how to access picture in memory
i have try used DirectShow but stiil can't
|
|
|
|
|
Can you be more explicit? what's the source of picture, what format is it in.
-Saurabh
|
|
|
|
|
Hello,
I wrote one post this day to my problem. Now I am able to describe my problem more detailed. So once more:
I want to write a base class and a class that manage a list of objects derived from my base class. The list-class should have a = operator that copies the whole list and creates copies of all its elements (derived from base class).
The base class is derived from CObject because of serialisation and so on. It also includes some basic methods and members.
<br />
class CBase::Cobject<br />
{<br />
....<br />
}<br />
Now I derive some classes from it.
<br />
class CA::CBase<br />
{<br />
}<br />
<br />
class CB::CBase<br />
{<br />
}<br />
<br />
All classes should have a = operator to copy its elements!
The list-class now have a list of pointers to some instances from CA und CB in a CObArray.
The = operator of the list-class shoud create a copy of the list an the members.
<br />
CBase* pElement1;<br />
CBase* pElement2;<br />
CRuntimClass* pRTC;<br />
int nIndex;<br />
<br />
for (nIndex=0; nIndex<pList->GetCount(); nIndex++)<br />
{<br />
pElement1 = pList->GetAt(nIndex);<br />
pRTC = pElement1->GetRuntimeClass();<br />
pElement2 = (CBase*)pRTC->CreateObject();<br />
pRTC = pElement2->GetRuntimeClass();<br />
*pElement2 = *pElement1;<br />
Add(pElement2);<br />
}<br />
<br />
pList is a pointer to the source CObArray-Object.
Add() adds an element in the destination CObArray-Object.
Now the problem:
*pElement2 = *pElement1 do not call the = operator of CA or CB. The = operators have no virtual behaviour. The result ist that not all elements (CBase and CA/CB) are copied. Only the = operator of CBase is called.
What is to do? And how can i call in the = operator function of CA the = operator funrction of CBase to copy the base elements?
And one more question:
What is the reason for the Cxyz& return type of the = operators and the return(*this) statement?
Thanx
Dr-Kuulun
|
|
|
|
|
operator= is not inherited and (I think) cannot be virtual. Polymorphism wouldn't apply to an assignment because the compiler has to know exactly what types are involved in an assignment. Each class is responsible for its own copying/assignment behavior.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
But the operator is represented by a function. Functions can be virtual. Why is it not possible for an operator? Now I wrote a virtual clone-function an the list class calls this function to copy the elements. This way works fine.
Dr-Kuulun
|
|
|
|
|
hi
i m using this code to for fileopen dialog with multiselection of files.
here is it
::OPENFILENAME ofn;
char *szFileName=new char[1024];
ZeroMemory(szFileName, sizeof(szFileName));
ZeroMemory(&ofn, sizeof(ofn));
ofn.lStructSize = sizeof(ofn); // SEE NOTE BELOW
ofn.lpstrFilter = "Bitmap Files (*.bmp)\0*.bmp\0All Files (*.*)\0*.*\0";
ofn.lpstrFile =szFileName;
ofn.nMaxFile = 1024;
ofn.Flags = OFN_EXPLORER | OFN_FILEMUSTEXIST|OFN_ALLOWMULTISELECT|OFN_READONLY;
ofn.lpstrDefExt = "bmp";
CString str;
if(GetOpenFileName(&ofn))
{
MessageBox(ofn.lpstrFile);
MessageBox(szFileName);
str=ofn.lpstrFile;//szFileName ;
CString temp;
str.Trim();
int index;
while(str.GetLength()>0)
{
index=str.Find('\0') ;
temp=str.Left(index);
MessageBox("The Extract:\t"+ temp);
str=str.Mid(index+1,str.GetLength());
MessageBox("The Remaing\t"+ str);
}
}
for single file selection it shows the full file name. for multiselection the ofn.lpstrFile contain only the directory name and nothing else i had shown that on the msgbox. it prints the directory. where in MSDN i read the after directory name then null and then file names are present. which are not.
Tasleem Arif
|
|
|
|
|
Your problem is here:
str=ofn.lpstrFile;
The CString will only contain up to the first NULL in the ofn.lpstrFile.
When the CFileDialog return OK, you need to do something like this:
pos = filedlg.GetStartPosition();<br />
while (pos != NULL)<br />
{<br />
name = filedlg.GetNextPathName(pos);<br />
m_pathlist.AddTail(name);<br />
m_pFileList.AddString(name);<br />
}<br />
m_pFileClear.EnableWindow(TRUE);<br />
m_pFileTouch.EnableWindow(TRUE);
That gets each file name selected and adds them to a CStringArray (m_pFileList) for later use.
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
<kmedcalf@ev1.net>
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
thanks for reply but i wanted to use only API not MFC class
char *pdes=::strchr(ofn.lpstrFile,'\0');
index=(int)(pdes-ofn.lpstrFile+1);
Drive=ofn.lpstrFile;
ofn.lpstrFile+=index;
while(strlen(ofn.lpstrFile)>0)
{
char *pdes=::strchr(ofn.lpstrFile,'\0');
index=(int)(pdes-ofn.lpstrFile+1);
str=ofn.lpstrFile;
ofn.lpstrFile+=index;
MessageBox(Drive+str);
}
dats solution i worked out thanks for answering me
Tasleem Arif
|
|
|
|
|
|
Hey Friends
I am trying to run a query like given below
select count(*) from table1
now when i try to read the value of the result using
GetFieldValue function
it gives exception that Value is big
I debugged the same & found that
the ODBCFieldInfo is treating the result as DBVT_SHORT hence if the value is large it is throwing an exception .
Any suggestions ?
|
|
|
|
|
Hey Friends
I wish to create a database viewer which can
a) list down records of tables
b) list down fields of tables
c) list down triggers of tables.
I am stuck when i am tryint to list down triggers of tables.
I am aware of CRecordset & CDatabae classes
|
|
|
|
|
Hey Friends
I got it
SELECT * FROM user_objects WHERE object_type='TRIGGER'
Now the problem is that how we can read the trigger details
i found using Desc statment
but how to run DESC using MFC ?
Thanks
|
|
|
|
|
What u meant by DESC statement ?
You can run this statement using ADODB.
use _RecordsetPtr->Open to execute the sql.
cheers...mil10.
|
|
|
|
|
Hey Thanks buddy
By saying DESC i meant the Trigger Details
I found a query for the same which i can run using CRecordSet & get the value
SELECT Table_name , Trigger_Name , Trigger_type , description, TRIGGER_BODY FROM ALL_TRIGGERS
Regards
|
|
|
|
|
If you want to develop a database program, i suggest u use VB - it is very easy to learn and very powerful for databse issues.
If you want to learn database in VC, i suggest u throw CRecordSet and all its related classes (i.e. CDatabase) away - they are very ugly. the best classes in VC are Cdatabase etc (d is lowercase) - they are very flexable and powerful, VB uses them at background. once u know Cdatabase etc, you are a master. u are a slave for forever if using CDatabase etc.
A special image tool for Windows C++ programmers, don't miss it!
The world unique Software Label Maker is waiting for you and me ...
A nice hyper tool for optimizing your Microsoft html-help contents.
|
|
|
|