|
kotiramkoteswararao wrote: Can you suggest me, possible solution
here this link will help :-
http://www.codeproject.com/cpp/UpdateResource.asp[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
When i create a modeless dialog, which pops a modal dialog then, the application will crash when i end the application with these dialogs stay opened.
-- modified at 0:01 Tuesday 20th December, 2005
|
|
|
|
|
How can you close your application when a modal dialog is open? Or is your application crashing when you close it when the modeless dialog stay open?
To use modeless dialog in application make a modeless dialog pointer as a member of your mainframe class. Here is the sample code for using modeless dialog box
class CModeless: public CDialog
{
// Construction
UINT m_nID;
CWnd* m_pParent;
public:
CModeless(CWnd* pParent = NULL): CDialog(CModeless::IDD, pParent)//standard constructor
{
m_nID=CModeless::IDD;
m_pParent=pParent;
}
BOOL Create()
{
return CDialog::Create(m_nID,m_pParent);
}
// Dialog Data
//{{AFX_DATA(COptionDllDlg)
enum { IDD = IDD_DIALOG_MODELESS };
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(COptionDllDlg)
protected:
virtual void PostNcDestroy();
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(COptionDllDlg)
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
afx_msg void OnDestroy();
afx_msg void OnClose();
};
void CModeless::OnDestroy()
{
((CMainFrame *) AfxGetMainWnd())->ModelessDlgDone();
CDialog::OnDestroy();
}
void CModeless::OnClose()
{
((CMainFrame *) AfxGetMainWnd())->ModelessDlgDone();
CDialog::OnClose();
}
void CModeless::PostNcDestroy()
{
delete this;
((CMainFrame *) AfxGetMainWnd())->ModelessDlgDone();
// CDialog::PostNcDestroy();
}
And In mainframe class add the following members
CModeless *m_pModelessDlg;
CModeless *ShowModelessDlg();
void ModelessDlgDone();
initialize m_pModelessDlg to NULL in the constructor
CMainFrame::CMainFrame():m_pModelessDlg(NULL)
{
...
}
CModeless *CMainFrame::ShowModelessDlg()
{
if (m_pScaleDlg==NULL)
{
m_pModelessDlg=new CModeless(this);
m_pModelessDlg->Create();
m_pModelessDlg->ShowWindow(SW_SHOW);
}
else
{
m_pModelessDlg->ShowWindow(SW_SHOW);
}
return m_pModelessDlg;
}
void CMainFrame::ModelessDlgDone()
{
m_pModelessDlg=NULL;
EnableWindow();
}
CMainFrame::~CMainFrame()
{
if (m_pModelessDlg)
{
m_pModelessDlg->DestroyWindow();
m_pModelessDlg=NULL;
}
}
|
|
|
|
|
Iam working on a module whose functionality is to connect UPS (Uninterupted Power Supply) to PCS USing WIndows MAnagement Instrumentation . Can U please Suggest How To Proceed With This .
abhi
|
|
|
|
|
I am working with embedded systems but i dont know
if there is any special service provided by windos
to manage a UPS .
But we have done such things with the help of Parallel
port.
If u get such information do put it up on the Codeproject
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
hello,
i write a control of word,and want to control the print of the word doc,and i learn can capture the beforeprint event of the word app object,but i do not know how to do it in visual c++,who can help me?
thanks.
|
|
|
|
|
|
Hi everybody
I have an instance of the IWebBrowser2 interface implemented by the internet explorer, and i need to know, how i can enable the block popups function.
|
|
|
|
|
Try this...
http://www.codeproject.com/tools/OxFF.asp[^]
Happy christmas friends. May the Love of My Lord and Saviour Jesus bring forth Joy and Happiness into your life too.
<marquee direction="up" height="30" scrolldelay="1" step="1" scrollamount="1" hspace="0" vspace="0">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
Hi everybody,
Let me introduce myself. My name is Quang Dien, a Vietnamese students. This term, I have to do a project about the fingerprint detecting.
About my profect, I had a source code on MATLAB, it can run on MATLAB perfectly. But, my program is written by VC++ 6.0, so, I have to use MATLAB COM Builder to build a component to use in VC++. I use MATLAB 6.5 R13 comtool to build it. "Standalone built completed !" , no problems. But, when I call it in VC++, no thing happen ! No error but no reaction. The input parameter is the same with itself when initializing. About my function, I can summarize for you as below :
Function score = cubs_match(input_file1, input_file2)
where :
input_file1 : the string holds the path to the fingerprint image1
input_file2 : the string holds the path to the fingerprint image2
score : a number between 0 to 100, show how much do 2 fingerprint images look like rach others.
When I built it, I use VC++ 6.0 call it as below :
// --> Set the input arguments to the COM method
VARIANT f1_Variant, f2_Variant;
VariantInit(&f1_Variant);
f1_Variant.vt = VT_BSTR;
f1_Variant.bstrVal = SysAllocString(L"C:/MATLAB6p5/work/Fingerprint/1_1.fp");
VariantInit(&f2_Variant);
f2_Variant.vt = VT_BSTR;
f2_Variant.bstrVal = SysAllocString(L"C:/MATLAB6p5/work/Fingerprint/1_2.fp");
// --> Set the output arguments to the COM method
VARIANT result;
// --> Create an instance of the COM object
IFingerprintClass *pImyclass;
hr=CoCreateInstance(CLSID_FingerprintClass,NULL, CLSCTX_INPROC_SERVER, IID_IFingerprintClass, (void **)&pImyclass);
// --> Access the method with arguments and receive the output out1
hr = (pImyclass -> cubs_match(1, &result, f1_Variant, f2_Variant));
// --> Print the result
CString Show_Screen;
Show_Screen.Format("Matching score : %g",result.dblVal );
MessageBox(Show_Screen);
Note : + My component has the name as "Fingerprint" and the Class name is "FingerprintClass"
+ The *.fp format is my own format.
But when run it, the result doesn't change. It return : -9.25596e+061
What is my problem ? How to solve it ? Please kindly answer for me if you know about my problems ...
Thanks a lot.
Best regards,
Quang Dien
____________________
PS : + Please reply your ans to me to : quangdien12jan@yahoo.com
+ About the Fingerprint Toolbox, you can download it form mathworks.com, search for "fingerprint recognition toolbox"
|
|
|
|
|
hi all, i have a question about using global anonymous unions in more than one .cpp file.
if i have this code:
static union {int y; int z;};
in one of my source files, how do i declare it in a header file so it can be used elsewhere.
These approaches do not work:
extern static union {int y; int z;};<br />
extern union {int y; int z;};<br />
extern int y; extern int z;
If I take the 'static' off, i get the following message:
test.cpp(9) : error C2646: global anonymous unions must be declared static
But static means internal linkage, so does that mean this is impossible?
Thanks in advance,
John
|
|
|
|
|
What exactly u mean the approch dont work
it gives error or it dont work logically .
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
Hey man what was the problem i didnot get any reply
i have tired it with my vc6 compiler it works fine
with my program .
I dont seeem any problem in it
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
the problem is i can only use one storage-class specifier, but static is required so i can't use extern. this current method works fine if i only need to access it through one source file, but my project has many source files and requires the members of this union to be accessed through many of those files. here is my current code, please post yours that works:
extern union {int y; int z;};<br />
<br />
#include "main.h"<br />
<br />
void do_something() {<br />
y = z;<br />
}<br />
<br />
static union {int y; int z;};<br />
<br />
void main() {<br />
do_something();<br />
}
i appreciate it,
John
|
|
|
|
|
why using an anonymous union ?
just give it a name !!
extern union myUnion {
int x;
int y;
};
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VisualCalc 3.0]
-- modified at 4:18 Tuesday 20th December, 2005
|
|
|
|
|
Yeh TOXCCT
Giving a name is good.
but an anonymous union also dont create any
issue , i tired and checked it out in my
project.
It works fine .
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
where is the name??? did u mean
extern union myUnion
{
int x; int y;
}mu;
is this ok?
"But your mind is very complex, very tricky. It makes simple things complicated. -- that's its work. And for centuries it has been trained for only one thing: to make things so complicated that your life becomes impossible."- Osho
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1"> --[V]--
|
|
|
|
|
|
mon cher ami,
ca va? je fais bein ici. (ok lets not squeeze my brain to get those french words out ) how's chirstmas preparations going on? is it full of snow? you ski? skate?
spend lot of time with your coupine?? what's going to be your gift for her this xmas???
"But your mind is very complex, very tricky. It makes simple things complicated. -- that's its work. And for centuries it has been trained for only one thing: to make things so complicated that your life becomes impossible."- Osho
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1"> --[V]--
|
|
|
|
|
VivekuniQ wrote: mon cher ami,
pas trop mal, merci
VivekuniQ wrote: ok lets not squeeze my brain to get those french words out
that was not so bad,, except the little "je fais bien" instead of "je vais bien", but nevermind.
VivekuniQ wrote: how's chirstmas preparations going on ?
full of work !!! actually, i'm still working until late friday evening, but i took time to buy some presents to my mum (who comes to see me and celebrate Xmas with us this year - she have to come accross 800kms to get here !), my sweet girlfriend and all her family in which i will pass the date (sisters, parents, boyfriends of her sisters too - which have the same first name as mine !! what a coincidence !)
VivekuniQ wrote: is it full of snow?
not where i am actually... i love snow, i love skiing, but i am near the atlantic (Nantes i you know), and snow if quite rare out there...
VivekuniQ wrote: spend lot of time with your coupine??
hum, not that much, but i'd like to !!! it's hard to find the time to spend with her when i work hard all the day, when she also have to study hard for her exam on january, and when we don't even live together during the week !! but hey, it's hard now to be better latter, isn't it ?
VivekuniQ wrote: what's going to be your gift for her this xmas???
i doubt that she looks at CodeProject (actually, she hate it ) but i cannot take the risk to write it there before Christmas... sorry
now, i hope you having a good time too...
Merry Christmas dear Vivek.
see you - On CP naturally...
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VisualCalc 3.0]
|
|
|
|
|
toxcct wrote: Merry Christmas
Merry Christmas ..... I hope that bring good thing to your life
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
its g8 that u can see ur parents in christmas
people like me have to wait for years to stay
with parents.
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
happy christmas to you too man , where do ur parents live?? faraway??
"But your mind is very complex, very tricky. It makes simple things complicated. -- that's its work. And for centuries it has been trained for only one thing: to make things so complicated that your life becomes impossible."- Osho
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1"> --[V]--
|
|
|
|
|
ThatsAlok wrote: I hope that bring good thing to your life
i'll be really happy if life brings somethingchristmas gift from mr.Alok!!
ThatsAlok wrote:
Merry Christmas .....
Merry Merry christmas!!
-vivek
"But your mind is very complex, very tricky. It makes simple things complicated. -- that's its work. And for centuries it has been trained for only one thing: to make things so complicated that your life becomes impossible."- Osho
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1"> --[V]--
|
|
|
|
|
VivekuniQ wrote: Merry Merry christmas!!
Yeap Marry Christmas ...
VivekuniQ wrote: somethingchristmas gift from mr.Alok
Hai... Today is D Day for me.. .
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|