|
CelestialCoder wrote: Suppose I develop a application in VisualC++ using VS2008 (Windows forms application),will it asks for dot net framework while it is deployed in another system?
Windows Forms is a part of the .NET framework and has nothing to do with Visual C++. So, if you develop a Windows Forms application, it will require the .NET framework to be installed on the computer where it would be deployed.
|
|
|
|
|
Rajesh R Subramanian wrote: Windows Forms is a part of the .NET framework and has nothing to do with Visual C++.
Then what was the windows applications created in VisualC++ using VisualStudio 6 (Prior to dot net) called?
Thanks for the time
With Regards
Roy Thomas
"..this file is known as source file probably because it is a source of frustration and anxiety!" - Chuck Sphar - In book 'C# 2005 for Dummies'.
|
|
|
|
|
CelestialCoder wrote: [Frown] Then what was the windows applications created in VisualC++ using VisualStudio 6 (Prior to dot net) called?
Native application?
But I see where you ask that question from. I need to mention you that if you write a Visual C++ application with the latest version of Visual Studio, that still would be a native application.
I'd tell you again: Windows forms is not a part of C++. It is a part of the .NET framework. You are just confusing .NET with C++. They are two different things.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
Rajesh R Subramanian wrote: if you write a Visual C++ application with the latest version of Visual Studio, that still would be a native application.
then How to create a native application (with a GUI like that we get initially in VS6) in VS2008 is my only issue.
Thanks a lot for the time.
I think we are close to solve the issue..
I opened VS2008 - selected VisualC++ as language-
Now to get a GUI I should select Windows forms application.. Wrong.. So go back..
But I cant find a place to start a native application. I know you are not suggesting that way. But how?
Then How to create a simple GUI with a simple text box and button (Like that we see in SAMs 24 Hr books 1st lesson) which can run in WinXP with no dotnet framework?
Thanks again
With Regards
Roy Thomas
"..this file is known as source file probably because it is a source of frustration and anxiety!" - Chuck Sphar - In book 'C# 2005 for Dummies'.
|
|
|
|
|
CelestialCoder wrote: But I cant find a place to start a native application. I know you are not suggesting that way. But how?
Open VS 2008, select Visual C++ as the language, and then select, for example:
MFC Application - An application that makes use of MFC libraries. This will require the MFC dlls to be present in the client machine. (You can do a little test with a dialog based application). This wouldn't require the .NET framework to run.
There's also win32 console application, MFC DLLs, Win32 project, etc., They all, each, solve a specific purpose.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
modified on Wednesday, August 13, 2008 6:37 AM
|
|
|
|
|
Hello
Thanks a lot. issue clear Now.
I choose MFC and selected dialogue based- appeared the form I was looking for. (Didn't checked with deployment, but I am sure it will be ok.
Thanks a lot for solving my confusion. Also for your valuable time.
With Regards
Roy Thomas
"..this file is known as source file probably because it is a source of frustration and anxiety!" - Chuck Sphar - In book 'C# 2005 for Dummies'.
|
|
|
|
|
CelestialCoder wrote: Thanks a lot for solving my confusion. Also for your valuable time.
My pleasure.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
May be this article will solve your confusion..
Windows Forms.[^]
Very first line of the article says this:
Windows Forms is the name given to the graphical user interface application programming interface (API) included as a part of Microsoft's .NET Framework, providing access to the native Microsoft Windows interface elements by wrapping the existing Windows API in managed code. While it is seen as a replacement for the earlier and more complex C++ based Microsoft Foundation Class Library,
Regards,
Sandip.
|
|
|
|
|
Hi all,
What does this mean?
1>PrefDlg.obj : error LNK2019: unresolved external symbol "protected: char * __thiscall CPrefDlg::EventTypeString(unsigned short)" (?EventTypeString@CPrefDlg@@IAEPADG@Z) referenced in function "protected: int __thiscall CPrefDlg::CreateEventLogEntryFile(int)" (?CreateEventLogEntryFile@CPrefDlg@@IAEHH@Z)
1>D:\SVN\Licensin System\Work Package\UpdateManager\Debug\UpdatePanel.cpl : fatal error LNK1120: 1 unresolved externals
I have linked the right headers here.
thanks,
Jayjay
|
|
|
|
|
monsieur_jj wrote: I have linked the right headers here
Looks like you also need to either implement the EventTypeString method
or link to the library (static or import) containing it.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi Mark,
Thanks, its just declared in my class like this:
BOOL CreateEventLogEntryFile(BOOL bTextFormat);
TCHAR * EventTypeString(WORD EventType);
Whats the matter with that?
|
|
|
|
|
That's the declaration - the actual implementation needs to exist somewhere as well.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi Mark
What do you mean? Isn't it as simple as just using it?
Jayjay
|
|
|
|
|
monsieur_jj wrote: Isn't it as simple as just using it?
No
The declaration declares the method's existence, but if you use
the method, its code has to actually exist somewhere.
Two ways to implement the method -
class CPrefDlg
{
public:
TCHAR * EventTypeString(WORD EventType);
};
TCHAR * CPrefDlg::EventTypeString(WORD EventType)
{
return 0;
}
or
class CPrefDlg
{
public:
TCHAR * EventTypeString(WORD EventType)
{
return 0;
}
};
Mark Salsbery
Microsoft MVP - Visual C++
modified on Tuesday, August 12, 2008 10:35 PM
|
|
|
|
|
Hi Mark,
aww im so stupid hehe i got it now.
Thanks,
Jayjay
|
|
|
|
|
Hello everyone,
Just a basic question about when (in what scenarios typelib) will be used, the current two scenarios I could think of are,
1. using typelib to browse information (e.g. type information) of a specific type;
2. universal marshaller using typelib to marshall.
Are there any other usage scenarios?
BTW: typelib is generated by IDL file from MIDL compiler, are there any other ways to generate typelib?
thanks in advance,
George
|
|
|
|
|
Hello,
I'm creating a CScrollView , onto which I draw things by overloading OnDraw(). In the View's OnPrint, I call OnDraw with the printing device context as an argument.
BOOL CMyScrollView::OnPreparePrinting(CPrintInfo* pInfo)
{
pInfo->SetMinPage(1);
pInfo->SetMaxPage(num_pages);
return CScrollView::DoPreparePrinting(pInfo);
}
void CMyScrollView::OnPrint(CDC *pDC, CPrintInfo *pInfo)
{
CurPage = (pInfo->m_nCurPage - 1);
OnDraw(pDC);
CScrollView::OnPrint(pDC,pInfo);
}
This has worked for me elsewhere, but, for reasons I have not yet successfully isolated, it does not work here as I'd like it to. I can view print previews, and can go forward to the next page, but not back to the previous, and I can zoom in but cannot zoom out. I have attempting to debug the problem with little success. Any insights that might help me to solve this problem would be greatly appreciated,
Regards,
Sternocera
|
|
|
|
|
Hello to everyone (as this is my first question here)
I'm trying to understand how class members aligned (with msvc compiler). I was expecting that this would be identical with a struct. And it is as long as the class doesn't contain virtual methods. But when it does sometimes are equal sometimes not. For example
struct s {
unsigned* p;
int n;
double d;
};
class cc {
public:
virtual void msg() { cout<<"c::msg"<<endl; }
private:
int n;
double d;
};
thanks in advance
modified on Tuesday, August 12, 2008 6:03 PM
|
|
|
|
|
That is probably because your allignment is set to 8. Try setting it to 4,and you should get sizes 8 and 12.
Bram van Kampen
|
|
|
|
|
Thanks for the quick response Bram.
Unfortunately this is not my problem. So let me make it more clear. I have a class with a virtual method (or two or a hudrent, there is no difference), an integer and a double and a 32bit os. So i expect to get 4 bytes for the vptr, 4 bytes for the int, 8 for the double and no need for padding anywhere between, because they are already aligned. Exactly what i have in the struct (pointer, int, double). Why do i get different sizes and member alignment?
modified on Tuesday, August 12, 2008 6:03 PM
|
|
|
|
|
Point Taken! Well, experimenting a bit, and checking offsetof(Struct,n) vs offsetof(Class,n), it appears that the compiler for it's own reason sets aside 8 bytes for the vtable pointer.
For one thing, you can be sure that this is and will be always these 8 bytes. The Entire COM architecture relies on the proposition that a Class with a virtual function equals a vtable Pointer followed by a structure. The C interface and the CPP interface are both able to work with the same data. If this were to change, the entire COM machinery would break.
Bram van Kampen
|
|
|
|
|
Sorry, no luck
If I get rid of the double in the class, I have 8 bytes size only
|
|
|
|
|
Its same for class and struct. For instance, Add a virtual function to struct s and you'll get the sizeof struct s as 24.
struct s {
virtual void msg() { cout<<"c::msg"<<endl; }
int n;
double d;
};
If you disable padding and check the size of class cc , you'll get 16 bytes for your class.
#pragma pack(1)
class cc {
public:
virtual void msg() { cout<<"c::msg"<<endl; }
private:
int n;
double d;
};
The point is, if your class have vtable, for some reason, compiler is adding a 4 bytes padding between vtbl ptr and other member variables. If you disable padding, it will be removed. I'm not sure about the purpose.
Well, I hope atleast my reply helped you to some extend.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
>>if your class have vtable, for some reason, compiler is adding a 4 bytes padding between vtbl ptr and other member variables
Thanks for the reply Jijo.
As I mentioned before, this doesn't seems to be a rule. If I have virtual methods and just an integer for data member, there is no padding. The size is 8 bytes.
I'm working on a small tutorial about inheritance, virtual calls etc in c++. Alignment is not a subject here, but since I demonstrate datamember access via offsets from the base address, I just want a clue why this happens, not the complete explanation.
modified on Wednesday, August 13, 2008 8:11 AM
|
|
|
|
|
Hi,
I've bookmarked this conversation. It merrits more investigation, particularly the effect of declaring a double. Sometimes MS has rules for their own reasons. My COM argument still stands I think. It may be a surrepticcious rule MS introduced to cover a previous bug. At least, it is unexpected behaviour.
Bram van Kampen
|
|
|
|