|
hi to all,
i finaly managed to get some free time and would like to create my first program using Visual Studio .NET. i would like a program with a nice menu, toolbar, dockable treeview on the left and other free space filled with richtextbox. it would be something like article writer, that's all. now i would like to find out few things, even though we're programming in vc++ .net on our faculty. anyhow, here they are:
1. when creating new .NET project, what type of project to select if i would like to write a program as mentioned above? should it be:
- Empty Project (.NET) or
- Windows Forms Application (.NET)
- MFC Application (MFC)
i noticed that that 2nd one has support for more Windows Forms components, also it has imagelist with selection about color depth etc. if i'm creating a program, it should also look good.
i noticed also, that in this example the best option is to use Windows Forms Applications.
What is your opinion? What are the actual diferences between those three?
2. but, if i'm talking about Windows Forms Application, i have a question about it,.. when viewing Class View for that type of project, i didn't noticed any main class. so, where to write my own code that would be executed when program would be runned? which is the main class when creating WFA?
3. the last question is somehow related with first two ones. i would really like to know, what type of project fits the best for a)dialog based applications (example- mIRC, UltraEdit, FTP programs, ... any kind of programs actually; if they're written in VC++ .NET)?
i would really apretiate your answers! thanks in advance and best regards to all
|
|
|
|
|
lordgreg wrote:
- Empty Project (.NET) or
- Windows Forms Application (.NET)
- MFC Application (MFC)
Depends, do you want to use MFC or .NET ? Both of these options will work, albeit they are vastly different, because they use different libraries to achieve the same goal.
lordgreg wrote:
What is your opinion? What are the actual diferences between those three?
1 - creates an empty app that links to .NET
2 - creates an app that uses Windows Forms and therefore requires the .NET framework and knowledge of managed C++
3 - creates an app that either statically links to the MFC dll, or requires it to be installed. MFC is how C++ Windows apps were written before VS.NET, and still are, but it's the older option.
lordgreg wrote:
when viewing Class View for that type of project, i didn't noticed any main class. so, where to write my own code that would be executed when program would be runned?
I'm starting to wonder if you are really creating your first program at ALL, in which case, you're being way to ambitious. You shoud learn C++ before learning ANY windows library.
A forms app will have a form class which has events you can put code into. So will an MFC app, for that matter.
lordgreg wrote:
i would really like to know, what type of project fits the best for a)dialog based applications (example- mIRC, UltraEdit, FTP programs, ... any kind of programs actually; if they're written in VC++ .NET)?
The answer is option 2 or 3, depends on what library you want to use.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
thank you for your answers Christian- they helped alot!
|
|
|
|
|
I have a Canon USB camera, and when you plug it in, a dialog comes up and asks what app to launch to use the camera. I want to register my app for this event. Can anyone tell me how ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
|
Would you believe I already have those example projects on my hard drive ? I must have done some research before and forgotten about it. Thanks for putting me on the right track.
Christian Graus - Microsoft MVP - C++
-- modified at 18:12 Wednesday 21st September, 2005
Actually, unless I'm missing something, none of this helps. I don't want my app to realise that a device was plugged in, I want the dialog box that windows generates and asks me what app to launch to include my app, so you can plug in the camera, and Windows gives you the option to launch the app.
I found these two registry keys, which seem to contain the info I am after:
HKLM/SOFTWARE/SYSTEM/ControlSet1/Control/StillImage/Events/STIProxyEvent
HKLM/SOFTWARE/SYSTEM/ControlSet3/Control/StillImage/Events/STIProxyEvent
I'm still trying to work out how it all fits though, I suspect I need to use some of the code from that link to get a GUID associated with the device, and use that to write a registry entry. Perhaps.
-- modified at 19:36 Wednesday 21st September, 2005
Thanks for the help, I found that there's a COM DLL I needed to interop and call to register my app for still image events.
|
|
|
|
|
|
Yeah, the issie is that you're leaking memory. Did you expect someone to look at the first few bytes and tell you waht the 38084 byte item is ? Surely you're not passing around enough 37k objects to not have an idea what it could be ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
! good thing there are smart people out there who answers question!
|
|
|
|
|
You're welcome. Both of us who answered told you the same thing, so I'm not sure if you're trying to insult him, or insult me. Either way, the question was impossible to answer in any way beyond what we told you.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Memory leaks are not something that is easily solved. It requires a good eye and patience. Perhaps you should use this problem to train those skills?
Good music: In my rosary[^]
|
|
|
|
|
I just found out what was the problem. Thanks!
|
|
|
|
|
|
two database files been opened and never release the allocated memory
|
|
|
|
|
I downloaded mapirtf.dll/mapirtf.lip from micorsoft.com to read the rtfbody. I'm getting run time error.. I think
What should I really pass for 1st parameter?
Where can I get the Profile name for 1st parameter?
<br />
CString GetRTFBody(_MailItemPtr pMailItem)<br />
{<br />
CString mailEntryID;<br />
CString pStoreID;<br />
HMODULE hdll;<br />
LPTSTR abody;<br />
MAPIFolderPtr pmailfolder = pMailItem->Parent;<br />
<br />
hdll = LoadLibrary(_MAPIRTF_DLL);<br />
if(hdll)<br />
{<br />
<br />
_readrtf readRTF;<br />
readRTF = (_readrtf)GetProcAddress(hdll,"readrtf");<br />
readRTF(pmailfolder->GetName(),pMailItem->EntryID,pmailfolder->StoreID,&abody);<br />
}<br />
<br />
CString rtfbody(abody);<br />
return rtfbody;<br />
}<br />
|
|
|
|
|
pnpfriend wrote:
I'm getting run time error.
Where?
pnpfriend wrote:
What should I really pass for 1st parameter?
To what function?
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Oh I'm sorry.
I'm getting error at readrtf () function.
I think I'm passing the wrong information to readrtf().. especially parameter one. Mapirtf.cpp explain about readrtf() defination as follow: but I dont' know where to get Profile name..
<br />
DllExport HRESULT WINAPI readrtf (LPSTR lpProfileName,<br />
LPSTR lpMsgIDSrc,<br />
LPSTR lpStoreIDSrc,<br />
LPSTR *lpRTF)<br />
In the example of readrtf() provided by microsoft, http://support.microsoft.com/?kbid=172038[^] get the session, mapi message and the logon then readrtf(). I'd tried to get the session of as follow, but doesnt' work.. I dont' know how to covert that vb example code (from 172038) to c++.
<br />
<br />
CoInitialize(NULL);<br />
_ApplicationPtr pApp; <br />
hr=pApp.CreateInstance(__uuidof(Application));<br />
if (FAILED(hr))<br />
{<br />
MessageBox("Unable to instantiate Outlook.","Outlook Error",MB_OK);<br />
return;<br />
}<br />
<br />
pNS = pApp->GetNamespace(_bstr_t("MAPI"));<br />
_NameSpacePtr session = pApp->GetNamespace(_bstr_t("MAPI.Session"));<br />
<br />
<br />
thanks for your reply David.
|
|
|
|
|
I also have another question
I tried to include mapix.h and mapiutil.h to my project so I can call
MAPIInitialize() and LPMAPISESSION session memeber functions.
However, when I run the application.. I got error saying
WCHAR: is redefiniation; different basic types. error is in "MAPIDef.h"
what am I missing again? do I need to support the unicode? if so how can I do that?
I tried to add
#ifundef UNICODE
#define _UNICODE
to stdafx.h but I still get the same error.
What can I do to get the rtf message body of email?
Thanks
|
|
|
|
|
I'm messing with the status bar of my MFC SDI app to change the message from 'ready' to 'working' while doing a lengthy computation using the setup linked below. I've got everything working except that intially there is no value for the default status text. I've tried calling StatusBarMessage() from the constructor and OnCreate events, but in both cases it causes a null reference exception because the GUI components haven't been created yet. Where should I move the initialization call to.
http://www.codeguru.com/Cpp/controls/statusbar/article.php/c2973/#more
|
|
|
|
|
Which pane of the status bar are you attempting to change?
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
The left most that normally displays "Ready" or a description of the current menu/toolbar item.
I solved my problem by calling the init code in InitializeInstance. *duh*
|
|
|
|
|
I also 'handled' WM_SETMESSAGESTRING in one of my MFC apps, and in that case I could set the message to anything I wanted, and also avoid messages I did not want to appear in the status bar that the framework might have posted automatically.
Oh, I also remember I did this because the message text was not in pane 0 of my staus bar, it was in the right-most pane instead of the left-most pane.
|
|
|
|
|
I'm trying to make an edit box that will involve more complicated entry than just one line. In fact, sometimes I want to prefill my edit box from a file. I've already set the multiline property, and the 'want return' property, so it appears to be working properly when typing into it, but if I load in information from a file, the newline characters get changed into a funny vertical blackened box. How can I get the edit box to format them properly, turning the newline character into an actual newline?
Danny
|
|
|
|
|
bugDanny wrote:
How can I get the edit box to format them properly, turning the newline character into an actual newline?
Use \r\n instead.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|