|
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
|
|
|
|
|
Hi all,
I want to know if it is possible to write a MFC DLL which can perform the following task:
- Check to see if the process / program arleady exists.
- And when return a code to indicate if it is there or not.
The problem is I have the code to do this. But I have no idea if it is possible in a dll. Cause in the MFC DLL i'm truggling to call the system DLL which has all the methods that I need to communicate with the processes.
If anyone could help or point me to a site on the net.
Thanx alot
Programm3r
|
|
|
|
|
Programm3r wrote: if it is possible to write a MFC DLL which can
If it can be done in an MFC EXE then it can be done in an MFC DLL.
"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
|
|
|
|
|
"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
Thanx for the help, but drop the Qoutes, this is my second time I have posted something .... Colin
|
|
|
|
|
Programm3r wrote: but drop the Qoutes,
That is my current signature, it is not for anyone specific. See your "Settings" page, you have a space for one also.
Just a little advice, if you are going to use the internet as a source of help you should not be so easily angered.
"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
|
|
|
|
|
yes its not problem(i think) only you need to return detaily from process to your program like(name,memory usage,thread,...)
whitesky
|
|
|
|
|
In DllMain you can find the reasons like Process Attach, Process Detach, Thread Attach, Thread Detach. You can do it there.
In MFC Dll you might have to do it in InitInstance override.
-- modified at 4:19 Wednesday 28th June, 2006
|
|
|
|
|
In my app I am using the FaxStartPrintJob API from WinFax.dll to send faxes. But I recently upgraded from VC6 to VC8 and in the upgrade I deleted the old Feb 2003 PSDK that contained the Winfax.h and winfax.lib files. Now VC8 and the new PSDK does not contain those files so I am unable to use that API unless I get a copy of those files somewhere.
What is the new method that one has to use to send faxes that replaces the FaxStartPrintJob API? I really liked being able to simply print to a fax DC so I am hoping the new method is just as easy.
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
Everything I find indicates fax support has not changed. Winfax.dll and Winfax.h is in the Platform SDK. Can't check for it myself in my VC8 environment at this moment or I would.
"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
|
|
|
|
|
I am finding the same thing, yet I do not have those files installed. Maybe I missed a setting when I installed VS8, but I wouldn't know which one as I selected to install everything.
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
Which PSDK is that? I checked my copy of the Windows Server 2003 SP1 SDK and it does contain the Winfax.h and Winfax.lib files.
|
|
|
|
|
Ok, thanks for the info. I will reinstall the PSDK (April 2005) and see if that changes anything
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
how we can add events to the menu items which we added in the rumtime
using
CMenu* menu2=AfxGetMainWnd()->GetMenu();
CMenu* submenu = menu2->GetSubMenu(0);
submenu->AppendMenu(MF_STRING, MF_BYPOSITION,m_SongName );
please help me,
advanced thank u,
sree.
|
|
|
|
|
See here
#define ID_MY_MENU 10000
afx_msg void OnMyMenu();
BEGIN_MESSAGE_MAP(CSDIView, CFormView)
ON_COMMAND(ID_MY_MENU, &CSDIView::OnMyMenu)
END_MESSAGE_MAP()
void CSDIView::OnMyMenu()
{
MessageBox(_T("Hello"));
}
void CSDIView::OnBnClickedButton1()
{
CMenu* menu2=AfxGetMainWnd()->GetMenu();
CMenu* submenu = menu2->GetSubMenu(0);
submenu->AppendMenu(MF_STRING|MF_BYCOMMAND, ID_MY_MENU,_T("Test") );
}
</code>
whitesky
|
|
|
|
|
thank u very much,
i have small doubts
CSdiView nad CFormView refer means.
because iam dealing with dialog based projects.
and also id_My_MEnu means in what menu we like to add am i correct?
thank u,
sree
|
|
|
|