|
Hello.
Apart from being said in your latest post on the subject, you will have to keep track of the length of the data.
There is no way to know (at this level) if a "zero-byte" is supposed to be a char array terminator or if the "zero-byte" is supposed to be written in the file.
In addition to lpVoid, you must have a "lpVoidDataSize" variable.
And then do this:
fwrite( cStr, sizeof(char), lpVoidDataSize, stream );
|
|
|
|
|
i have an excell sheet as a database, what is the complete code in c# to read my database?
|
|
|
|
|
raniam wrote: visual c#
Oops. Wrong discussion board. C# is too safe for us. We like livin' on the edge on this side of town.
Try the C# board...
C#[^]
|
|
|
|
|
Hi,
I have a problem with the subitem character size.
When I insert a subitem (or item) with more of 255 character size, this control only show the first 255 characters.
How to insert a subitem with more of 255 character length?
Ivan Cachicatari Blog[^]
www.latindevelopers.com
|
|
|
|
|
Hmm. I never noticed that before but you are right.
Somebody posted this link elsewhere in CP about a bug. I'm not sure if it'll help you but here's the link...
From FredBloggsy[^]
-- modified at 17:47 Sunday 28th May, 2006
By the way, I was on VC++ 6.0 when I reproduced it so it seems it's in all versions. It does seem to be a "reasonable" limit for the most part.
|
|
|
|
|
CString Test = "Remove the word TEST"
how i remove the TEST ?
so i gonna have
CString Test = "Remove the word "
|
|
|
|
|
CString sData="Remove the word TEST";
CString sWord="TEST";
int nIndex=sData.Find(sWord,0);
if (nIndex!=(-1)) { // Found it
sData.Delete(nIndex,sWord.GetLength());
}
TRACE("%s",sData);
|
|
|
|
|
thank you very much bob16972 you helped me much today
|
|
|
|
|
Another method is :
CString Test = "Remove the word TEST";
Test.Replace("TEST","");
|
|
|
|
|
That'll remove every instance of the word "TEST". The other will remove the first instance only.
Just a heads up for the sake of clarity.
For what it's worth...
|
|
|
|
|
yes that is true, btw what she/he wanted exactly ?
|
|
|
|
|
Honestly I'm not sure at this point. You were right in posting your stuff. I wasn't jumping on it. I just threw in the clarification for they're benefit so they knew the implications of each method.
Sorry if I approached that wrong. It never dawned on me that the user might want all instances removed so I'm glad you caught that.
Thanks and take care.
|
|
|
|
|
bob16972 wrote: That'll remove every instance of the word "TEST". The other will remove the first instance only
In that case how will he/she determine which TEST keyword he have to removed
"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
|
|
|
|
|
Hi All,
I have a formview app with a propertypage imbeded in a nother property page.
How do I link this to a menu?
Any help would be greatly apreciated.
Ferdinand
|
|
|
|
|
A formview app should have a menu already. Are you asking how to make menu items do something in your formview?
If you could provide a little more detail describing the problem and context, I would be less reluctant to post a suggestion.
Thanks
|
|
|
|
|
Yea, I'm trying to link menu items provided by the app wizard to dynamic property page within a property page.
|
|
|
|
|
Ok, it's been a while since I messed with these but I found an app and got my trusty old Jeff Prosise book out and the rust is started to give a little.
Forgive me if I'm off a little at first but you say "menu items provided by the app wizard". Are you using VC++ 6.0 or VC++ 2003 or VC++ 2005? I'm thinking your referring to the MFC wizard DDX/DDV stuff but I afraid to go that route without confirmation.
I'm thinking of a dialog resource that needs it's fields "bound" to member variables for the Propert Page class. Let me know if I'm on or off target here.
|
|
|
|
|
Hi Bob,
First, Thanks for the help.
I'm using VC++ 6.0. When I use the app wizard, It places the command handlers in the correct class, but the menu items are still greyed out.
|
|
|
|
|
Is this what your looking for?
void CYourFormView::OnUpdateSomeMenuItem(CCmdUI *pCmdUI)
{
// TODO: Add your command update UI handler code here
if (Some expression that resolves to TRUE if menu should be enabled)
pCmdUI->Enable(TRUE); // Enable the menu item
else
pCmdUI->Enable(FALSE); // Disable the menu item
}
-- modified at 1:38 Monday 29th May, 2006
|
|
|
|
|
Actually, I was looking for something more like this.
IMPLEMENT_DYNCREATE(CMYView, CFormView)
BEGIN_MESSAGE_MAP(CMYView, CFormView)
ON_WM_SIZE()
ON_COMMAND(ID_FILE_OPEN, OnFileOpen)
ON_COMMAND(ID_SAVEAS_TEXT, OnSaveasText)
N_UPDATE_COMMAND_UI(ID_SAVEAS_TEXT, OnUpdateSaveasText)
END_MESSAGE_MAP()
If placed in the view class everything works fine. However, if this is placed in an embeded class, I don't recieve the messages in that class. and nothing happen.
|
|
|
|
|
unfortunately I cannot see a way to make that work. At least not directly.
I googled and found some articles relating to ON_UPDATE_COMMAND_UI and dialogs. WM_KICKIDLE gets tossed around quite a bit in those articles but it's somewhat over my head I think.
I'm leaning toward the CFormView ON_UPDATE_COMMAND_UI handler since it can see the PropertySheet/Pages public info. Any decisions that influence the results of the ON_UPDATE_COMMAND_UI you planned in the PropertySheet/Pages could still be performed in the CFormView.
Sorry that I wasn't able to provide any help on the matter. I did piece a FormView app like you described and tried brute forcing it but it seems much more complex than I anticipated.
Good luck in your efforts.
|
|
|
|
|
Thanks anyway,
I didn't find anything useful on the net either.
I think I'll just handle the message in view class and call the page functions from there.
Thanks again.
|
|
|
|
|
I got 4 dialog in my application
Which is the command for Destroy a dialog?
There is command so i can use both ,child and parent ,dialog ?(or it needs a thread ?)
|
|
|
|
|
|
hm?
I have a MFC project with 1 parent CTestDlg (with his CTestApp)
i have create 3 Form Class (CTest1Dlg, CTest2Dlg, CTest3Dlg)
CTest1Dlg and CTest2Dlg are Children of CTestDlg
CTest3Dlg is child of CTest1Dlg
What i have to put in the CTest1Dlg::OnNewWindowButton()
so i can view + act on both CTest1Dlg and CTest3Dlg ?(or i cant?)
|
|
|
|