|
thathvamsi wrote: Isnt OnInitDialog() automatically generated by classwizard?
Yes. I've never seen it not be generated.
thathvamsi wrote: how do i include OnInitDialog()?
Via ClassWizard.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
how we get the IDs of the menu items
ram.
|
|
|
|
|
<br />
CMenu m;<br />
m.GetMenuItemID(pos);
whitesky
|
|
|
|
|
Hi
I have a CTabCtrl in a resizeable dialog and it flickers a lot if I resize the dialog. Any ideas, e.g. make it an owner draw control?
/M
|
|
|
|
|
See Here[^] maybe it is some helpful to you
whitesky
|
|
|
|
|
thanks. Indeed I am going owner-draw now.
|
|
|
|
|
Very good.
|
|
|
|
|
|
Hi,
Maybe today isn't my best day but could anyone tell me what is wrong with this snippet ?
class CTest
{
public:
CTest()
{
(*(this)).lpFunc = &CTest::Write;
}
long Write(DWORD dwInfo)
{
...
}
long (*lpFunc)(DWORD);
}
I've got error C2440:
'=' : cannot convert from 'long (__thiscall CTest::* )(DWORD)' to 'long (__cdecl *)(DWORD)'
and when I change line: (*(this)).lpFunc = &CTest::Write;
to
(CTest::*lpFunc) = &CTest::Write;
I've got another error code:
error C2059: syntax error : '<tag>::*'
Generally I want to point on lpFunc a pointer to Write fuction but within class (I don't want to any globals).
-----------
Mila
-- modified at 3:15 Wednesday 28th June, 2006
|
|
|
|
|
Mila025 wrote: '=' : cannot convert from 'long (__thiscall CTest::* )(DWORD)' to 'long (__cdecl *)(DWORD)'
notice the calling convention of the two parts of your operator = reported by the compiler.
you function Write has to be either static or global. the fact is that being a class member function implicitely adds it the this pointer parameter...
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
|
|
|
|
|
static need be there ONLY if it is not a member of the class.
|
|
|
|
|
certainly not !!!
compile the code and tell if the compiler complains...
-- TTD --
|
|
|
|
|
That Write method MUST be static.
So solution is :-
class CTest
{
public:
CTest()
{
(*(this)).lpFunc = &CTest::Write;
}
static long Write(DWORD dwInfo)
{
...
}
long (*lpFunc)(DWORD);
}
|
|
|
|
|
That's not how you declare a member function pointer.
class CTest
{
public:
CTest()
{
lpFunc = &CTest::Write;
}
long Write(DWORD dwInfo)
{
...
}
long (CTest::*lpFunc)(DWORD);
};
<pre>
|
|
|
|
|
Dear friends pls check the following program
I tried it in VC++ compiler and the size of structure is depending on the order of variables
What is the reason behind it
any one pls answer me
Thanks
// struct.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "iostream.h"
struct st1
{
char q ;
int p;
}a1;
struct st2
{
char q ;
char r;
int p;
}b1;
struct st3
{
char q ;
int p;
char c;
}c1;
int main(int argc, char* argv[])
{
cout << sizeof(a1);
cout<
|
|
|
|
|
From MSDN...
"When applied to a structure type or variable, sizeof returns the actual size, which may include padding bytes inserted for alignment."
|
|
|
|
|
Thanks bob
Thank you very much
|
|
|
|
|
|
|
I need to convert vc++ code to net with the available dll files.How should i do this?
my existing code is in vc++ and i want to make web based application in asp.net using this code..
can u plz help me out how to do this..
|
|
|
|
|
You are talking of calling the unmanged code into the managed code. you will find some articles on this ,here on codeproject.
What do you mean exactly by conversion?
You will have to rewrite the code on the .NET platform if you don't go with the above option
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
-- modified at 2:30 Wednesday 28th June, 2006
|
|
|
|
|
rename .cpp files to .net
You will have to rewrite the whole thing in the language that you want.
|
|
|
|
|
hafz wrote: how to do this
learn .NET and then do the conversion.
"Just about every question you've asked over the last 3-4 days has been "urgent". Perhaps a little planning would be helpful?" Colin Angus Mackay in the C# forum
led mike
|
|
|
|
|
Dear VC-master,
Thank you for your attention,
In my MDI project, the based view is CFormView. named CMyView.
the problem is,
in CMainFrame class, SetValue()was defined.
in CMyView class, public function SetEdit(true)was defined.
in myview.cpp, if I use below, it is ok.
void CMyView::OnSendValue()
{
CMainFrame *pMainfram = (CMainFrame *)AfxGetMainWnd();
pMainfram->SetValue(0x55);
}
but if In MainFrm.cpp
void CMainFrame ::OnSendValue()
{
CMyView *pMyView= (CMyView *)<b>GetActiveView();</b>
pMyView->SetEdit(true);
}
it can build successfully, but <b>failed execute.</b>
how to call the function/variable in active view?
|
|
|
|
|
My first question is have you verified that the CMainFrame::OnSendValue() function is even getting called?
Run this in Debug mode...
void CMainFrame::OnSendValue()
{
TRACE("CMainFrame::OnSendValue() called\n");
CMyView* pMyView=(CMyView*)GetActiveView();
pMyView->SetEdit(true);
}
Do you see the output from the TRACE in the output window?
-- modified at 2:38 Wednesday 28th June, 2006
|
|
|
|