|
Follow this scheme:
class CFrmTmpl : public CFormView
{
protected:
CFrmTmpl();
CFrmTmpl(UINT uId);
...
);
CFrmTmpl::CFrmTmpl(UINT uId)
: CFormView(uId)
{
...
}
CFrm1::CFrm1()
: CFrmTmpl(CFrm1::IDD)
{
...
) The idea is to have an additional constructor in CFrmTmpl that accepts the IDD from its derived classes. In this scheme, the default ctor for CFrmTmpl is never used, though I think DECLARE_DYNCREATE(CFrmTmpl) requires it.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hi, buddies,
Say, I programmed a simple text editor, when users open a file to edit, The
file may be changed outside of the editor, How do I know that? Which window
message should be response?
Thanks you.
|
|
|
|
|
You might want to have a look at FindFirstChangeNotification .
|
|
|
|
|
Hi,
I'd like to know if there's some way to programatically change the label of a CD-RW that is formated with Adptec DirectCD. This aplications "formats" the CD and allow user to copy, move and delete files on the CD as if they were on a HardDisk.
The label can not be changed by explorer, like the other kinds of disks, so I'd looking for a way to chage the label without using the Adpatec burner software.
Best Regards,
Igor
|
|
|
|
|
I believe UDF has two five-sector volume descriptors. Using ASPI or SPTI I think it should be possible to erase and rewrite those using packet-writing, but I'm really not sure.
How? I haven't got a clue. You might want to try e.g. google and look for some Linux packet driver to get an idea of the SCSI commands involved. You'd probably also need to know a bit about UDF, why you probably have to scan some UDF source code also.
++luck
|
|
|
|
|
When the Class Wizard in VC++ 6.0 is out of sync, Microsoft recommends to delete the CLW file and then press Ctrl+W to build up the file again.
If there would be an Add-In to automatically delete the CLW file, this would be very handy.
Since the CLW-file is text-based, it should be even possible to build it automatically from all files in the project. This could be very helpful if your project has many files in many subdirectories.
Does anyone know such an Add-In?
--
See me: www.magerquark.de
|
|
|
|
|
Hi,
After my questions the other day about getting single lines out of CAsyncSocket, I thought a good starting & learning point would be to knock up something I know and understand, namely an SMTP daemon.
So, I implemented it a bit like this:
CSMTPDaemon : public CAsyncSocket
-- is set up to bind and listen on port 25. It spawns a new CMailConnection for every connection (up to a maximum of 5 concurrent connections)
CMailConnection : public CAsyncSocket
-- handles the SMTP connection. The OnReceive Event tacks new data onto the end of a buffer (a char * member var). It then calls a member function ProcessCommand, which inspects the buffer for a full line (ie characters ending with a CRLF pair). if it finds a line, it copies the command line to a different buffer. it then shrinks the main buffer and moves any other data forward (FIFO style). If we got a command line, then another function is called to handle the command... choose a response and so on.
I use mutexes extensively to ensure that only 1 thread a) reads or writes to the buffer at any one time, and b) sends or receives on the socket at any one time.
Anyway, it all works really well. Sort of. I can have my own SMTP conversation with it (using TELNET) and it's fine. I set up MX records for a dummy domain, and send mail to it using my regular mailserver (sendmail on UNIX) and it's fine. But, if i set my Microsoft Outlook to use it as it's outgoing SMTP server, it falls flat on it's face. In that it stalls.
R: "HELO WLBDP322[\r\n]"
S: "250 Why, hello to you too![\r\n]"
R: "MAIL FROM: <my@adress.com>[\r\n]"
S: "250 jon@monstereurope.com....Sender OK[\r\n]"
is what i get in my TRACE window. My app sends a (correct) response to the MAIL FROM command. the CASyncSocket::Send command returned successfully. But the input buffer is empty. The OnReceive function does not get called. If I force a Receive(), using MSG_PEEK, there is no more input to be had.
So it seems that for some reason, outlook just isn't talking to me after that last response. And I don't know why.
A long shot. Does anyone have any ideas???
Thanks
Jon
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
Fetch some TCP sniffer and have a look at a dialog between Outlook Express and a commercial SMTP server. My guess is that you'll spot some significative difference with your interaction that will explain the problem.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I did that! (there don't seem to be many (good) (free) packet sniffers out there though).
I was doing this: (simplified)
char p_strCmd[]="200 Ok\r\n";
Send(p_strCmd, sizeof(p_strCmd), 0);
But sizeof(p_strCmd) includes the terminating null, which i'd forgotton. so i was actuially sending "\r\n\0". Which was screwing outlook up halfway through the mail process.
It works fine now. Pretty quick too, i've impressed myself
Thanks (again!) Joaquin!
Jon
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
Can anyone help me figure out how to fix this syntax error. i am trying to transfer my Board Class to a MFC wizard generated application. the Board class was created before in another program but i decide to reuse it but it gives me this error:
fatal error C1010: unexpected end of file while looking for precompiled header directive
I know my class declaration and implementation is working fine. so i went and included my class to the CBoardView. but then it gave me this error. can anyone tell me ? what's wrong?
|
|
|
|
|
You forgot
#include "StdAfx.h"
|
|
|
|
|
Either include stdafx.h or tell VC to not use precompiled headers for your file.
Go to Project > Settings
Choose All Configurations
Select your file (board.cpp ?)
Select the C/C++ Tab on the right
Choose the category Precompiled Headers
Then select Not using precompiled headers
Hope I got that right
honk() if $you->love(PERL);
|
|
|
|
|
THANKS... I REALIZED THAT AFTER AWHILE..
|
|
|
|
|
It's beeter to use automatic use of precompiled files
Because with the other selecction when you make a liitle change the compiler recompile oll the file again, with the automatic choice the compiler don't do that...
Regards
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
I created a ToolBar using TBSTYLE_LIST style.Used following code to add buttons and Icons. I want to place icon on the left of ButtonText, but the Icons cover the button text(cascade),why?
void CMyToolBar::AddSomeButton()
{
SetButtons(NULL,n);
GetToolBarCtrl().SetImageList(image);
for(int i=0; i< n ;i++)
{
SetButtonInfo(i, nID, TBSTYLE_AUTOSIZE|BTNS_SHOWTEXT, iImage);
SetButtonText(i, lpszText);
}
}
Thanx
|
|
|
|
|
If you use icon for regular CButton class it cover the button text,there is two solution
1.use CBitmapButton ,but its painful.
2.subclass CButton and draw it your self,like the buttons in CP,
I suggest you use one of buttons in CP,they are really perfect.
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
The button is not CButton, just a ToolBar button.
|
|
|
|
|
What styles are you using in creation of the toolbar? AFAIK, the BTNS_SHOWTEXT button style is only useful when the toolbar has the TBSTYLE_EX_MIXEDBUTTONS style; it is unnecessary if you want to display the set text for all your buttons.
farewell goodnight last one out turn out the lights Smashing Pumpkins, Tales of a Scorched Earth
|
|
|
|
|
I remove BTNS_SHOWTEXT flag,but it doesn't work also.
I want to create a toolbar like IE with adding button dynamicly.
|
|
|
|
|
Nothings coming to mind i'm afraid... Are you making sure to add all the buttons before the toolbar is first shown?
If you'd like to send me the code you're trying to use, i'd be happy to take a look at it.
farewell goodnight last one out turn out the lights Smashing Pumpkins, Tales of a Scorched Earth
|
|
|
|
|
Or must I use that from C Runtime Library.
I looked at lstr... functions in docs but didn't find any suitable.
|
|
|
|
|
What is wrong with using CRT ?
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
I am just trying avoid linking with static library whenever I can link with system DLL (the case of WinAPI functions). Static linking enlarges my exe file, and this is the only cause I am looking for equivalent.
|
|
|
|
|
To the best of my knowledge there's no equivalent API to strrchr (nor to strchr BTW). But writing your own versions to avoid linking the CRT is extremely easy.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
It's really easy if you use the CRT source code (strrchr.c)
Gavin
|
|
|
|