|
Never mind I´ve solved the problem! Thanks.
Jesper S.
|
|
|
|
|
I am planning on creating a kind of file transfer client.
The thing is:
1)how is the CASyncSocket at transferring binary info (is there another alternative?)
(Will there arise any unforeseen problems with CASyncSocket?)
2)is CString an alternative AT ALL when considering storing the info received from the sockets. (How is it at storing BINARY INFO, that is)
Or should one use char buf[SIZE] or something?
I have only been thinking about this, not studying the CString or CASyncSocket classes in depth.
I thought that I should check it with someone here with experience on this.
-Oddis-
|
|
|
|
|
1)CASyncSocket doesn't care what you are sending binary or text it takes the whole data as binary.
2)To send a file open it in binary and then use char* or void* buffer to send it through your socket. To send a binary data all you have to do is to open a file in binary the buffer will contain binary data.
In my dream, I was dorwning in my §orrow§
But my §orrow§, they learned to §wim
|
|
|
|
|
Project is an SDI FormView derived app.
Ok, I replaced the Icon in the resource file and named it IDR_MAINFRAME, all well and good. The icon in the usual place is right, in the taskbar it's right, in explorer it's right. But here's the kicker: When I right click on the debug executable and hit properties, I get the right icon. When I right click on the release executable and hit properties, I get the default MFC icon. I've tried rebuilding clean to no avail. Any ideas what I'm doing wrong? Thanks in advance
--
Peace,
Amit Jain
|
|
|
|
|
How many icons do you have in the executable? Are you using 256 colors or more?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
There's only the two that come as default, so I think it's 32x32x16 and 16x16x16.
--
Peace,
Amit Jain
|
|
|
|
|
Hitting F5 should fix that. If not, clearing your shell icon cache with TweakUI will definitely fix it.
--Mike--
http://home.inreach.com/mdunn/
Ford: How would you react if I said that I'm not from Guildford after all, but from a small planet somewhere in the vicinity of Betelguese?
Arthur: I don't know. Why, do you think it's the sort of thing you're likely to say?
|
|
|
|
|
It worked, whoo hoo! Thanks!
--
Peace,
Amit Jain
|
|
|
|
|
Hey!
I have a dialog box stored in a DLL. From my parent app, I load
the DLL and present the dialog to the user. Problem is,
tabbing doesn't seem to work. (I don't even have that the little
dotted rectangle to show which control has focus). I've read
somewhere that this is a known problem with MFC. Is this true?
Is there anything I can do to fix it?
Steve The Plant
|
|
|
|
|
Hmmmm... I worked on multiple-dll projects with many dialogs and never encountered this problem. Can you check your controls with Spy++ - do they have WS_TABSTOP style set?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Spy++ says that they do. All the controls are set to
their default settings (ie I didn't change them), so
that means they should all have WS_TABSTOP set.
Steve The Plant
|
|
|
|
|
|
I used the AppWizard to Generate a "Regular MFC Dll using shared MFC DLL".
In the DLL, I have an exported function that the client app
uses. I have the exported function, I initialize a dialog like so:
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
m_oMainDialog.Create(IDD_MAINDIALOG);
m_oMainDialog.ShowWindow(SW_SHOW);
dwLastErr = ::GetLastError();
}
This is the dialog where tabbing doesn't work. The dialog needs
to be modeless, so that it doesn't interfere with the operation
of the client app.
Steve The Plant
|
|
|
|
|
From VC++ help:
Regular DLLs must have a CWinApp-derived class and a single object of that application class, as does an MFC application. Unlike the CWinApp object of an application, the CWinApp object of the DLL does not have a main message pump. [...]
If the DLL opens modeless dialog boxes or has a main frame window of its own, the application's main message pump must call a routine exported by the DLL, which in turn calls the CWinApp::PreTranslateMessage member function of the DLL's application object.
This should clear things a little bit.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Hi, I have a CPropertySheet class object with several CPropertyPages in it. There are situations where I would need to prohibit the user from having access to a partiular PropertyPage. Is there a way to gray out that PropertyPage Tab to prevent it being selected?
Thanks in advance,
Jerry Wang
|
|
|
|
|
There's no flag or message for disabling tabs. You'll have to use owner-draw. Have a look at March 1998 issue of Microsoft Systems Journal, C++ Q & A column - it has the code you need. This article may be in your VC++ help; search in the 'Periodicals' section. If it's not there, go to msdn.microsoft.com, then MSDN Magazine and Past Issues.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Thank you Tomasz, I found the 1998 Q&A article. It is very helpful. Too bad the grayout feature is not implemented. I think what I'm gonna do is just have a pop-up window notifying the user noting the tab features are not activated and do a YES/NO/CANCEL to ask if he/she would like to activate it at this time.
sigh, so much for wanting to make the program nice and neat
Thanks Tomasz, thanks Carlos and Mike!
Jerry
|
|
|
|
|
Too bad the grayout feature is not implemented.
"Not implemented?" What do you mean? The article presents the code that grays out and disables the tabs.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
And why don't remove the page?
I don't Know if you can to prohibit the click in any tab. Try disabling the Dialog, that is part of the PropertySheet.
Best Regards!!!
Carlos Antollini.
|
|
|
|
|
It is not desirable to remove the page. I would like to let the user know that the features exists, but are only activated when the user checks a checkbox. I do not want the user to fiddle with the features inside the tab while having the checkbox unchecked and wondering why no action is happening.
What is the function call to disable the dialog? I tried ShowWindow(FALSE) w/o success.
|
|
|
|
|
The command is EnableWindow();
Cheers!!!
Did you try with the article that said Tomasz???
Carlos Antollini.
|
|
|
|
|
Unfortunately VC++ doesn't like EnableWindow(FALSE) either. I just tried it in my CPropertySheet::OnInitDialog() and it gave me an run time assertion error. Apparently it is not a window and stops at
<br />
BOOL CWnd::EnableWindow(BOOL bEnable)<br />
{<br />
ASSERT(::IsWindow(m_hWnd));<br />
...<br />
}<br />
where this == 0x01251ca0
and m_hWnd == 0x0
I will look into the article Tomasz mentioned.
|
|
|
|
|
Try it before or after OnInitDialog. It's not a window because at this point it hasn't been fully created yet.
|
|
|
|
|
I'm not sure if you can do it with EnableWindow or not. You can use RemovePage and AddPage but that probably isn't what you want.
I hadn't thought about it but now I'm trying to find an example of a disabled property page.
|
|
|
|
|
I'm attempting to set my XML document's encoding at the start of the file with SAX's IMXWriter interface.
I'm using
pWriter->put_encoding(CComBSTR("UTF-8"));
pWriter->put_standalone(VARIANT_TRUE);
where pWriter is a CComPtr with interface IMXWriter.
The put_standalone command works, but the put_encoding is ignored and stays at UTF-16. What's wrong? I'm getting an HRESULT of 0 from both commands, so apparently no problems there.
CodeGuy
The WTL newsgroup: 910 members and growing ... http://groups.yahoo.com/group/wtl
|
|
|
|