|
I guess Alok answered my question, thanks.
|
|
|
|
|
Hello,
I don't understand your problem exactly, but if this declaration is inside a funktion, well you declare a variable and reset it to zero, then ++ it.
could you please try using 'static int ... ' instead of your currnt statement? does it solve any problem?
|
|
|
|
|
I think you need to declare the count variable outside this function, eg. declare it as global or class member variable. If you declare in this function, every time you click the mouse, the counter is reset to zero.
|
|
|
|
|
how to write into the serial/parallel/USB port
using VC++6?
thx
|
|
|
|
|
|
up.
Before the main frame is created I want to display splashwindow for 3 seconds. how to do it?
|
|
|
|
|
Add A Splash window Control in your project.
you can find Splash window Control here ->
Project->add to Project->Component and Controls
Select Directory ->Visual C++ Components
and scroll to SplashWnd and insert it into your project.
"I Think this Will Help"
[Vote One Here,.....]
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
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
|
|
|
|