|
how do i retain items in the list control so that even when i close the application, the items would still be availiable in the list control.
|
|
|
|
|
Save it to a file. At the time of retrieval just read from the file
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
how can i do that, i am very new in programming
|
|
|
|
|
Read the items from the list control. When you are closing your application/relevant dialog write the contents of the list to a file.
Use CFile, CStdioFile, fread() / fwrite() to put/get the data to/from the file and put it in the corresponding rows/columns of the list control when you are calling the list control dialog to display again
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
jokefake wrote: i am very new in programming
So have you not studied up on file I/O? That's very basic stuff, that should be mastered before advancing on to more difficult topics.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
if you have for example a listbox
(1) Create a file with CFile or CStdioFile
(2)read items in the loop from listbox m_litsbox.GetText(i,str);
(4)write to file
(3) close file
And read MSDN and a good book
whitesky
|
|
|
|
|
Hi all ,
I am new to VC++.Net 2005 version.
can u help me how to bring ActiveX control on Dialog window.
We do this in Vc++6.0 like
project|Add to project|components and controls and add it to project. Can you help me how to make this in .Net version.
Thanking you,
sheshidar
|
|
|
|
|
Hi all,
I am able to Read only one Message Using MapiFindNext(...) and MapiReadMail(...) Please let me know where i have gone wrong.
//==========================================================================
HINSTANCE hMapi; //Instance handle of the MAPI dll
hMapi = LoadLibrary(_T("MAPI32.DLL"));
LPMAPILOGON MAPILogon; //MAPILogon function pointer
LPMAPILOGOFF MAPILogoff; //MAPILogoff function pointer
LPMAPISENDMAIL MAPISendMail; //MAPISendMail function pointer
LPMAPIRESOLVENAME MAPIResolveName; //MAPIResolveName function pointer
LPMAPIFREEBUFFER MAPIFreeBuffer; //MAPIFreeBuffer function pointer
LPMAPIFINDNEXT MAPIFindNext;
LPMAPIREADMAIL MAPIReadMail;
MAPILogon = (LPMAPILOGON) GetProcAddress(hMapi, "MAPILogon");
MAPILogoff = (LPMAPILOGOFF) GetProcAddress(hMapi, "MAPILogoff");
MAPISendMail = (LPMAPISENDMAIL) GetProcAddress(hMapi, "MAPISendMail");
MAPIResolveName = (LPMAPIRESOLVENAME) GetProcAddress(hMapi, "MAPIResolveName");
MAPIFreeBuffer = (LPMAPIFREEBUFFER) GetProcAddress(hMapi, "MAPIFreeBuffer");
MAPIFindNext = (LPMAPIFINDNEXT) GetProcAddress(hMapi, "MAPIFindNext");
MAPIReadMail = (LPMAPIREADMAIL) GetProcAddress(hMapi, "MAPIReadMail");
ULONG err;
LHANDLE lhSession; // Need a session for MAPIFindNext.
CHAR rgchMsgID[513]; // Message IDs should be >= 512 CHARs + a null.
MapiMessage *lpMessage; // Used to get a message back from MAPIReadMail.
int i; // Ubiquitous loop counter.
int totalLength; // Number of characters printed on a line.
err = MAPILogon(0L,"MicrosoftExchangeServer",NULL,0L, 0L, & lhSession); // Session handle.
if (err != SUCCESS_SUCCESS) // Make sure MAPILogon succeeded.
MessageBox("Error: could not log on");
do
{
err = MAPIFindNext(lhSession, // explicit session required
0L, // always valid ulUIParam
NULL, // NULL specifies interpersonal messages
NULL, // seed message ID; NULL=get first NULL,
MAPI_LONG_MSGID, //MAPI_LONG_MSGID |
0L, // reserved; must be 0
rgchMsgID); // buffer to get back a message ID.
// retrieve the message
err = MAPIReadMail(lhSession, // Explicit session required.
0L, // Always valid ulUIParam.
rgchMsgID, // The message found by MAPIFindNext.
MAPI_SUPPRESS_ATTACH, // TO DO: handle attachments.
0L, // Reserved; must be 0.
&lpMessage); // Location of the returned message.
if(err != SUCCESS_SUCCESS) // Make sure MAPIReadMail succeeded.
{
MessageBox("Error");
}
if((lpMessage->lpOriginator->lpszName != NULL) && lpMessage->lpOriginator->lpszName[0] != '\0')
AfxMessageBox(lpMessage->lpOriginator->lpszName);
else
AfxMessageBox(lpMessage->lpOriginator->lpszAddress);
}while(err == SUCCESS_SUCCESS);
//=========================================================================
uday.
|
|
|
|
|
See Here[^]
maybe it is some helpful to you
whitesky
|
|
|
|
|
What is the value of err ?
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi,
I have problem with close application. My application use ActiveX control. This ActiveX control contains CImage variable. When is called some function of CImage then by the close application is problem - application is not close. Do you know why? When I no call any function of CImage, application is corret close.
Please help me.. Thanks
|
|
|
|
|
I dont know your code but maybe your problem is with hdc or a null handle in his class or i guess maybe your want to release sources from this class
whitesky
-- modified at 8:12 Friday 21st July, 2006
|
|
|
|
|
No, hcd is correct.. I use CImage.load(...) and then I have problem with close - is not called any error, simply application is not close. I read that is some problem when is CImage in ActiveX - it is true?
|
|
|
|
|
if you read that some problem is with CImage in Activex why you use form it in ActiveX
whitesky
|
|
|
|
|
because I read it now.. I need CImage in ActiveX.. I don't can rebuilt all application
|
|
|
|
|
I was resolved this problem. I was installed Service Patch 1 for the
Microsoft Visual Studio .NET 2002 Service Pack 1...
link for download:
http://msdn.microsoft.com/vstudio/downloads/updates/sp/
|
|
|
|
|
Hello!
I want to create an WindowsFormApplication in VC++.NET (MSVS 2005)
which uses a TabControl.
In my Application the user should be able to create or remove tabPages,
so i`d like to have the Pages always fill the entire width of the TabControl!
I already tried with FillToRight, but that doesn`t worked...
So my Question is, why not? does FillToRight works only if there is a second row (mulitline true)? Or am i simple too stupid? I work on that for the last 4 hours!!!
Is there another way to set the Size of these TabPage "Heads" or do i have to write my own TabControl Class? (like http://www.codeproject.com/cs/miscctrl/flattabcontrol.asp)?
Pls can anyone help me?
Thx
Leitman
We would change the world...if god gave us the source code
|
|
|
|
|
I think its CLI/C++ right?
|
|
|
|
|
Hi,
I am using OFN "Open" and "Save as" file dialogs. It appears in the corner of the screen. How can i bring it to the centre. As we are not creating it what can be the solution without customizing it.
Thanks in Advance,
Poornima
|
|
|
|
|
|
|
of course
whitesky
|
|
|
|
|
atimpoo wrote: How can i bring it to the centre.
Just use a hook procedure. In that procedure, respond to the WM_INITDIALOG message and center the window accordingly.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
atimpoo wrote: As we are not creating it what can be the solution without customizing it.
IMHO, you have to customize that!
"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
Support CRY- Child Relief and You
|
|
|
|
|
See
<br />
...<br />
insert OFN_ENABLEHOOK to m_ofn.Flags<br />
m_ofn.lpfnHook = (LPOFNHOOKPROC)ofnProc;<br />
BOOL CALLBACK ofnProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg)
{
case WM_INITDIALOG:
MoveWindow(...);
break;
}
}
</code>
whitesky
|
|
|
|