|
i might be tempted to grab the stuff off the clipboard into a buffer then send a few messages to the ie window to select all and copy ... then grab that text into another buffer and restore the first buffer
prolly a better way but ie stuff isnt my strong point either
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
> i might be tempted to grab the stuff off the clipboard into a buffer
> then send a few messages to the ie window to select all and copy
I would be too, but:
o The "Internet Explorer_Server" window does not respond to WM_COPY or EM_SETSEL messages
o That would cause a visual "blip" on the target window, which is undesired.
But thanx for the response, anyway.
-=- James.
|
|
|
|
|
I'd like to program a ftp-server.
Can anyone tell me, what i have to do
in order to set up one?
A little bit c++ code or a link
would be nice...
thanks...
FoxHunter
|
|
|
|
|
well foxy its not quite so simple unfortunately.
"a bit of code ... would be nice..." would amount to a few thousand lines of code at the least.
maybe you should research the basic stuff of network programming, multi-threading and the ftp protocol as a good start.
its not rocket science in theory but getting a good ftp server that actually works and is scalable, robust and efficient is a bit of an art.
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
"I'd like to build my own B2 bomber, could you please point me to somewhere I can get all the parts for free and tell me how to put them together? Just a short explanation would be nice... thanks..."?
|
|
|
|
|
Ok... it wasn't quite that drastic
Adam
cabadam@houston.rr.com
|
|
|
|
|
Can anyone tell me if the following code is correct:
class CMyPropertySheet : public CPropertySheet
{
// ...
public:
virtual int DoModal();
protected:
static int CALLBACK PropSheetProc( HWND hwndDlg, UINT uMsg, LPARAM lParam );
}
class CMyDialogTemplate : public CDialogTemplate
{
friend CMyPropertySheet;
}
int CMyPropertySheet::DoModal()
{
m_psh.dwFlags |= PSH_USECALLBACK;
m_psh.pfnCallback = PropSheetProc;
return CPropertySheet::DoModal();
}
int CALLBACK CMyPropertySheet::PropSheetProc( HWND hwndDlg, UINT uMsg, LPARAM lParam )
{
switch ( uMsg )
{
case PSCB_PRECREATE:
{
LPDLGTEMPLATE pTemplate = ( LPDLGTEMPLATE )lParam;
CMyDialogTemplate dlgTemplate;
dlgTemplate.m_hTemplate = ::GlobalHandle( pTemplate );
dlgTemplate.m_dwTemplateSize = CMyDialogTemplate::GetTemplateSize( pTemplate );
dlgTemplate.SetFont( _T("Tahoma"), 8 );
dlgTemplate.Detach();
break;
}
default:
break;
}
return 0;
}
I am in doubt if it is allowed to modify property sheet template this way.
Although I have tried it out on NT4 and everything looked just fine.
Regards,
Nikolay
|
|
|
|
|
Small question... Why not use SetFont in the CPropertyPage-derived class(es)? You can use it in CPropertyPage::OnInitDialog(...). You can set the font for the dialog, and its controls right there.
-=- James.
|
|
|
|
|
Because I set the desired font for my CPropertyPages in the Resource Editor (although MFC ignores font settings for CPropertyPages in the Resource Editor , it could be easily solved by overriding CPropertySheet::BuildPropPageArray()), and at run-time, I want to set the sheet's FONT to be the same and SIZE everything correctly.
Unfortunately, the Windows Property Sheet control was designed so that it always uses the system font for the sheet. So the problem is that I need to specify somehow the desired font for the CPropertySheet itself. Above is my solution.
Regards,
Nikolay
|
|
|
|
|
Does anyone know how to create a property sheet then create it in a Dialog Bar (DIFFERENT THEN A DIALOG!) I've been have problems doing this in MFC. Thanks
|
|
|
|
|
I need a Blue Combobox with white text:
I have a new class CBlueComboBox derived from CComboBox. My combo is declared in my Ressource
as OwnerDraw, Fixed and has String.
In the new class I overwrite the DrawItem function:
void CBlueComboBox::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
{
ASSERT(lpDrawItemStruct->CtlType == ODT_COMBOBOX);
CDC dc;
CString strText;
GetLBText (lpDrawItemStruct->itemID,strText);
dc.Attach(lpDrawItemStruct->hDC);
COLORREF crOldTextColor = dc.GetTextColor();
COLORREF crOldBkColor = dc.GetBkColor();
if ((lpDrawItemStruct->itemAction | ODA_SELECT) &&
(lpDrawItemStruct->itemState & ODS_SELECTED))
{
dc.SetTextColor(::GetSysColor(COLOR_HIGHLIGHTTEXT));
dc.SetBkColor(::GetSysColor(COLOR_HIGHLIGHT));
dc.FillSolidRect(&lpDrawItemStruct->rcItem, ::GetSysColor(COLOR_HIGHLIGHT));
}
else
{
dc.SetTextColor(RGB(255,255,255));
dc.SetBkColor(RGB(41,66,148));
dc.FillSolidRect(&lpDrawItemStruct->rcItem,RGB(41,66,148));
}
dc.DrawText(strText, &lpDrawItemStruct->rcItem, DT_SINGLELINE | DT_NOPREFIX | DT_NOCLIP | DT_VCENTER);
dc.SetTextColor(crOldTextColor);
dc.SetBkColor(crOldBkColor);
dc.Detach();
}
All is OK apart the text: Combo si blue, text is white
but the text is not written correctly, it is alway the same control caracter.
Could someone help me?
Thanks
Natacha
|
|
|
|
|
CString strText;
GetLBText (lpDrawItemStruct->itemID,strText);
should be
CString strText;
int len;
len = GetLBTextLen(lpDrawItemStruct->itemID);
GetLBText (lpDrawItemStruct->itemID,strText.GetBuffer(len));
strText.ReleaseBuffer();
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
Just change "strText" by "(char*)((LPCSTR)lpDrawItemStruct->itemData)" when drawing the text.
My test is working. Good luck !
|
|
|
|
|
does anyone know how to determine whether windows requires a login or not.
i.e. need to know if a system is multi-user or not.
cheers
Neil
|
|
|
|
|
Using VC++ 6.0
I'm writing a DLL and it works fine from a C++ program. However, a friend of mine wants to use the DLL from a VB app.
My exported prototypes look like this:
extern "C" void FAR PASCAL EXPORT SR_GetString(char* sRunning);
typedef void (FAR PASCAL* LPFNsr_GetString)(char* sRunning);
I also have a .DEF file with this export line:
GetString @1
In my C++ program (that uses this DLL), I do this:
HMODULE hMyDLL = ::LoadLibrary("MyDLL.DLL");
LPFNsr_GetString m_fnSRGetString = GetProcAddress(hMyDLL, "SR_GetString");
char cText[255;
(m_fnSRGetString*)(cText);
I get the expected results (cText contains the expected string).
My Objective:
I want to make this DLL VB-friendly (*NOT* VB-specific) while having minimum impact on the code I've already written in both my C++ app and the DLL in question. I plan on requiring 32-bit VB in order to use the DLL, so the 16/32-bit concerns should be NULL.
If anyone can steer me, give me hints, tell me outright how to do it, etc, I'd be most appreciative.
Last thing, besides the DLL, what file(s) do I have to give the VB programmer who wants to use it?
|
|
|
|
|
i posted an answer to your jsimmons3@satr...... account
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
damn - i'm at work...
Could I convince you to post it here too?
|
|
|
|
|
i dont think i can upload an attachment here and theres a lot of code to rifle thru if i'm to sort out the bits you need only
is there an email at work i can send it to?
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
the VB person only needs the DLL and perhaps your .h file so he (i'll assume "he") can see the function declarations. then he'll need to write some VB function import/declarations for your DLL. if you're kind, you'll write these function declarations for him
as far as compatibility - VB can deal with C interfaced DLL's (not C++) pretty well. i tend to stick with 32-bit parameters, and if i have to pass a structure, i make sure the elements of that structure are all 32 bits. this way VB can use "Long" for all of your parameters (except strings).
the only thing you really need to be careful of is getting the VB function declarations right - match parameter sizes and get the correct ByRef/ByVal flags on those parameters.
-c
------------------------------
Smaller Animals Software, Inc.
http://www.smalleranimals.com
|
|
|
|
|
Hello. I´m trying to run a new program from a mfc application. I have probed with
'system', but a new DOS windows appears. Does anyone how to manage it?
|
|
|
|
|
|
Do you know any way to inicializate a CMapStringToString like a static array? In a static array I do it:
CString array_of_string[]={"dog","cat","horse"}
but in CMapStringToString, is it possible? Thanks
|
|
|
|
|
G'day Jane,
I don't think you can do this as the CMapStringToString class doesn't
have an '=' operator.
If you derived you own class and added an '=' operator, you'd need to
pass it two values (a key and string) which I don't think would work.
(BTW: I'd be perfectly happy to be proved wrong here. )
Do you only need to do this for a single CMapStringToString object?
Maybe you could derive a class from CMapStringToString which initializes
itself in the constructor from a couple of static text arrays.
Something like this...
static char* lpszKeys[] = {_T("Key1"), _T("Key2"), NULL};
static char* lpszText[] = {_T("Text1"), _T("Text2"), NULL};
CMyMapStringToString::CMyMapStringToString()
{
int nPos = 0;
while(lpszKeys[nPos] != NULL){
SetAt(lpszKeys[nPos], lpszText[nPos]);
nPos++;
}
}
This might get a bit tedious if you have several different
CMapStringToString objects to self-initialize though.
Just a thought.
Steve
--------------------------------------
Steve Driessens
www.resortsoftware.com
|
|
|
|
|
I need a process to be started right when all dialog init is done and the window has been displayed, what is the easiest way to do this??? I'm sure this is very simple
|
|
|
|
|
put a call to CreatProcess() [or CreateProcessEx()] at the end of your InitDialog() function or trap the WM_SHOWWINDOW message and put it there after calling the base class handler
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|