|
hi!!
You can just create a dialog window... and use "BitBlt" to display any bitmap... add a timer control..and after the timer expires... start the app.. hope you fing this useful - V.G
|
|
|
|
|
But I can't use Timer in PreCreateWindof function.
|
|
|
|
|
you use it during the creation of the Frame window...just make it invisible... after the time expires, make it visible..ok? -V.G
|
|
|
|
|
I think about this:
<br />
BOOL CRightHTMLView::PreCreateWindow(CREATESTRUCT& cs)<br />
{<br />
MSG message;<br />
<br />
int i=0;<br />
m_nTimer = SetTimer(1, 100, NULL);
ASSERT(m_nTimer!=0);<br />
if(i==0)<br />
{<br />
dlg->DoModal();
if(::PeekMessage(&message, NULL, 0, 0, PM_REMOVE)) {<br />
::TranslateMessage(&message);<br />
::DispatchMessage(&message);<br />
}<br />
i = 1;<br />
}<br />
Then
<br />
void CRightHTMLView::OnTimer(UINT nIDEvent)<br />
{<br />
Sleep(3000);<br />
dlg->DestroyWindow();<br />
KillTimer(1);<br />
<br />
CHtmlView::OnTimer(nIDEvent);<br />
}
Did you mean the same?
|
|
|
|
|
Thank you! I did it
|
|
|
|
|
can I use serialize to store and reterive non array data for example lets say that I have a class that has some array variables that I can use serialize to store them, but what if I want to also store some unique variables to the same file after all array data has been stored, is there a way or can I append data to that file ?
thanks in advance
|
|
|
|
|
If you're talking about serializing data in an SDI/MDI application, then it shouldn't be that difficult as long as your Document class knows about it. Serialization isn't resticted to arrays.
The heart of serializion is the CArchive class. Here's the documentation for CArchive::operator <<[^]. CArchive has a ton of overloads for this function (and their opposites CArvhive::operator >> ) to accomodate serializing (and deserializing) most common data types.
Just add the serialization code for your unique values after you've serialized your arrays by using a "cout "-type syntax, if that's where you want them to be.
Assuming you have the CArchive object, you can do something like this with any non-array values:
struct MyUniqueStuff
{
int nUniqueInt;
float fUniqueFloat;
char cUniqueChar;
void Serialize(CArchive & ar);
};
void MyUniqueStuff::Serialize(CArchive & ar)
{
if( ar.IsStoring() )
{
ar << nUniqueInt;
ar << fUniqueFloat;
ar << cUniqueChar;
}
else
{
ar >> nUniqueInt;
ar >> fUniqueFloat;
ar >> cUniqueChar;
}
}
Then, when you want to serialize or deserialize a MyUniqueStuff structure, just call its Serialize method.
Bob Ciora
|
|
|
|
|
|
Hi, I defined a CSplitterWnd variable in my CMainFrame class of a SDI project and want to access it from my CDocument class so I can have a pointer to different views that I have so I can post messages of Update and ... to each view according to cicumstances. I tried to get a pointer to the main frame by AfxGetMainWnd()->GetParentFrame() but the pointer is invalid and causes debug assertion, I think because when I want to access this pointer on OnNewDocument function still there is no main frame. so what is the solution how can I have a pointer to CMainFrame in CDocument so I can update different views from CDocument? or should I change the strategy and update view messages should come from other places. the application receives data from serial port and upon reception of some data views should be updated. thank you
|
|
|
|
|
Use this to get a pointer to the mainframe window from anywhere in your application:
CMainFrame* pMainFrame = (CMainFrame *) AfxGetMainWnd(); /ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Hi,
I am looking for an API that will return the 'group' to which the currently logged in user belongs.
Or is it a way to know if the currently logged in user belongs to a paricular user group?
|
|
|
|
|
Hi there,
Do you mean you want to list the groups of the user running your program?
I think the process is (sorry I don't have any example code):
ImpersonateSelf() - to generate an access token for the current process
OpenThreadToken() - to open the access token
GetTokenInformation() specifying TokenPrimaryGroup or TokenGroup as one of the parameters - to get a data structure with group information
Then walk the structure from this last function, looking for the group SID or SIDs.
Finally, to convert a SID to an actual text group name, use:
LookupAccountSid()
Hope this is a pointer in the right direction !
Thanks,
Neil Humphreys.
|
|
|
|
|
|
|
Hi,
I am looking for some neat code to process HTTP Post request content data - i.e. tidy up all those '+'s and '%'s, and split the POST content string into variable name / variable value pairs. I could try this myself, but I do hate reinventing wheels ... can anyone suggest some code to do this ?
Thanks,
Neil Humphreys.
|
|
|
|
|
|
Thanks for the reply.
Your article is a web client, which writes POST requests (presumably). However, I am after web server code, which reads POST requests.
Thanks,
Neil Humphreys.
|
|
|
|
|
Sorry, I should have ready your post more closely before replying. Meanwhile, will this[^] collection of classes help?
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
VC++.net : I have a problem, maybe someone can help me.
I try tu make a DLL to use with a client (Cocreate ME10).
I created a Regular DLL with MFC statically linked.
Then i created a CDialog with a CComboBox and a CListbox what i like
to fill with Items from a Database.
In the CDialog Class i created a Control variabel to the CCombobox:
CComboBox m_ctlCbNames;
To make work my modeless Dialog i use :
BOOL WINAPI FilterDllMsg(LPMSG lpMsg)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
TRY
{
return AfxGetThread()->PreTranslateMessage(lpMsg);
}
END_TRY
return FALSE;
}
If i load the DLL in my Client application the Dialog appears without
any Problems.
But if i try to add a string to the Combobox control variabel :
m_ctlCbNames.AddString(_T("Test"));
or
m_ctlCbNames.SetCurSel(0);
then i get the following Error when i call my function in the DLL from
my client program :
Debug Assertion Failed !
...vs70builds\...\afxwin2.inl
Line757
alfred.furer@skynet.be
|
|
|
|
|
I made a very nice duplicate file finding utility for myself a few months ago.
Now I just wanna share it with you guys (altough I am not very sure who would ever require such a tool ! Anyone ?)
However, I just want to add some more features to the basic framework.
The basic engine just creates a hash table of filenames which are kind of open chained using linked list of filenames which have the same MD5/SHA/etc digest (that is, are binary equal)
It currently finds out any duplicate file(s) in/on your directory/drive and deletes all but the file with the most recent timestamp.
That's all I wanted, but I understand that it's the least somebody who seriously wants to use such tool would want !
So please, let me know who might want it, and what feature(s) should I add to it....
Given enough takers, I might write up a nice article to go along with the source code.
In the meanwhile, keep the feature requests rolling in...
Regards
Subhobroto Sinha
http://www.geocities.com/subhobrotosinha
|
|
|
|
|
Hello Freinds,
I want to transfere one structure from client to server. structure contains one String and INT data, INT is the length of that string.
I am trying send(); function of CSocket to transfere the structure but I am getting some garbage at server end and missing my strings address.
Can anyone pl's help me.
I have dought that the function I am using may not be currect.
Thanks.
Dinesh.
|
|
|
|
|
why don't you directly transfered the string to the server!,as recv winsock api returnd with total length of data recieved.
something like this way, i am giving win32 based code
Client End:
char szString="Codeproject";
UINT nszLen=strlen(szString)+1;
send(hSendingSocket,szString,nszLen,0);
Server End
char szString[1024];
int nTotalBufferLen=1023;
int nRecv=recv(hRecvingSocket,szString,nTotalBufferLen,0);
szString[nRecv]=NULL;
"I Think this Will Help"
[Vote One Here,.....]
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
Dinesh, I recommend using CSocketFile and CArchive . They work beautifully!
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Thanks Ravi,
I will try this option.
Dinesh.
|
|
|
|
|
Hi friend,
Maybe the problem is that, if you are using TCP/IP protocol, the structure is divided as multiple packets on the network, so you should first send the size of the structure (string + int), then use recv() and check that the number of bytes received are equal to the size of the structure before using the structure, or USE UDP/IP.
something like this:
<br />
int nRecv=0;<br />
<br />
while(nRecv<SizeOfExpectedData)<br />
nRecv+=recv(....);
//now i am sure i received the whole message, not just few packets
//now use the structure
Mohammad Gdeisat
|
|
|
|