|
Have the calling process pass a HANDLE to itself to the callee. Make sure this HANDLE is inheritable and then when you call CreateProcess to create the callee ensure the bInheritHandles argument is set to TRUE. The callee can then call WaitForSingleObject passing in this HANDLE to wait until the caller has exited.
Steve
|
|
|
|
|
I have a char* that holds a numeric value of for example: 172,500 and I want to multiply this by another number and write the contents back to a new char*. Could someone give some example code on how to easily achieve this?
|
|
|
|
|
You can use atoi and itoa functions to achieve this.
atoi - converts string to int.
itoa - converts int to string.
|
|
|
|
|
Andy H wrote: for example: 172,500
Actually is there a comma (,) ?
- NS -
|
|
|
|
|
There is a (,) in the string.
What I think I will do is write a class that can cater for all eventualities, as there is also a possibility of the number being in scientific notation, just to make matters worse!
|
|
|
|
|
You can do it simple... first filter out the comma.
If you are using the CString, use str.Remove(',') so that the comma will be filtered. Then you can convert it to integer using atol, atoi, etc., or _ttol, _ttoi, etc.
- NS -
|
|
|
|
|
hi
i am new to MFC and i have a small (my first ) program-sort of schedular program .I want to package it and deploy it to my friends so that they can run 'setup' and install it in their PCs. is it much work to do that and how is it done?
thanks in advance
|
|
|
|
|
You want to make an installer. There's many ways to do this, commercial packages and freeware.
I use "Advanced Installer" -- they have a freeware version... http://advancedinstaller.com/feats-list.html#free[^]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.soonr.com">SoonR Inc -- PC Power delivered to your phone</A>
|
|
|
|
|
|
Hi,
Is there any SDK of winzip through that I would be able to create zip file, or is there a way I can create zip file programmatically that can be opened by winzip and winrar utilities.
Best Regards,
Mushq
Mushtaque Ahmed Nizamani
Software Engineer
Ultimus Pakistan
"English is my second language; please excuse any grammatical or spelling mistakes"
|
|
|
|
|
|
HBRUSH b = CreateSolidBrush(255);
SetLastError(0) ;
if( DeleteObject(( HGDIOBJ)b) )
{
printf( "brush deleted\n" ) ;
}
DWORD dw = GetLastError() ;
printf( "%d" , dw ) ;
----------------------------------
the above code returned..
brush deleted
0
when i debuggin this app gdi object count is incremented by one from 4 to 5(on windows taskmanager) when calling CreateSolidBrush, the deleteobject function return success but the gdi object count is still at 5.
iam using vs2003 under winxp sp2
thanks....
|
|
|
|
|
I had faced the same issue regarding the brush and pen objects. But I failed to get a solution.
See my post in CP[^]
- NS -
|
|
|
|
|
If you have the GDI object selected into a DC at the time of the DeleteObject() , the object will not be deleted. You must first use SelectObject() to restore the original object, before using DeleteObject() .
|
|
|
|
|
But this issue is not due to that. Even if we just create a brush and delete it very next, this issue exists.
- NS -
|
|
|
|
|
|
hi
since when Apply is clicked in a property sheet, its OnAplly() calls updateData() for the active page and initializes an ELLPROP structure with the settings, then sends a message to the main window containing the structures address.The main Window forwads the massage to the view (so far so good),the view copies the property values to its own data members (comes the problem) -suppopse i have many property sheets,each one will have an OnApply() that will fill the ELLPROP Structure with its own values, the mainframe will handle OnApply Once like this
LRESULT CMainFrame::OnAplly(WPARAM wParam,LPARAM lParam)
{
m_wndView.SendMessage(WM_USER_APPLY,wParam,lParam);
return 0;
}
then the view also will handle it once
..view::OnAplly(WPARAM wParam,LPARAM lParam)
{
ELLPROP* pep = (ELLPROP*)lParam;
// my question what do i do here (if am supposed to do it only here) if i have multiple property sheets
// lemmi give an example i may think of using proprty sheets insead of very many dialog boxes to write a simple school management program.
so one property sheet be for registration (first page studets reg, 2nd page staff reg,3rd page, members reg ..), another property sheet will be for finance (1st page setting the fees charges,2nd page payment of fees, 3rd page payment os salaries and wages to workers, 4th page payment of bills ..)
know i want each to update a database using ADO so each property page will have to open an appropriate recordset and do that(i havent tried the database part and know whether it will bring problems too),what i have tried is to have all the input values sent to the view so that i can display them in the client area and i dont know how the view's member variables will copy all these values that are coming from different property sheets and each sending an ELLPROP structure..(should i have some kind of control to know that this structure is from the finance sheet so just copy the finance deatils and leave the registration details- and if so how do i control that)
.......
.....
}
am new to MFC (4 mths know) so please if you can give me more deatils i'll rilly appreciate,thanks.
i h
-- modified at 2:28 Monday 13th August, 2007
|
|
|
|
|
Can you reword the question, to others understanding ?
Prasad
MS MVP - VC++
|
|
|
|
|
king`ori wrote: each property page will have to open an appropriate recordset
This is a flaw in your design: The document should hold the connection to the database, and the views (a property sheet is a view) access the property sheet.
This holds true even if your application does not use MFC Doc/View.
This paradigma is called model/view/controller and is independent of the toolkit used. You just might have to code more yourself.
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
HAI Everybody,
I am doin chat program between client to client thro server. In my chat i am providing different font styles,if i choose a fontstyle then the same font styles has to send it to another client.
currently the data alone is sending and receiving. The selected styles are displayed in sender richEditbox, but in receiver side the styles are not coming...default font's only coming......How to do this...?
I am doin this all in MFC...
Please Help me.
Mani
|
|
|
|
|
Are you sending the styles too through the network? I think you r sending plain text message only through the network to the other client. If so you must send the styles too, in some format along with the message text and then use this style at the other end's to display it.
|
|
|
|
|
hai Ktm Techman,
Yes, Ur correct...I am sending the plain text only, But How to send the font styles also.How can I send Font styles ? Whether any API is there....or If you know any examples code pls send it to me.....
|
|
|
|
|
It depends upon the protocol you are using. If you are using your own protocol, either you can use HTML/RTF tags, and parse it upon receiving, and display accordingly, or u can make your own cool way, like,
Text: " ";Font:"Arial";Bold:1;Underline ;StrikeOut; ....
Or
U can even send the Font style object as binary data (if your protocol supports), cast it at the other end,
like Text:"Msg";Font object
|
|
|
|
|
How is ULONGLONG related to unsigned int64? I guess the length of this primitive type is 8 bytes?
|
|
|
|
|
In a Windows app, a ULONGLONG is an alias for a unsigned __int64.
It's 8 bytes long, yes.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|