|
Anders Molin wrote:
you are really good at offending other people, I'll give you that.
LOL - it works in real life, too.....
Anders Molin wrote:
Of course, but why do you bring it up every time you answer a post where people mention crt?
I guess I am just accustomed to people using the CRT because they don't know there are alternatives. I probably have STL blinkers on, I'll admit that. But the majority of times I get to discuss it with people, I do find that they really don't realise it's not the only alternative.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
I have to say that I dont like STL much, that probably make me a bit quick too.
I have made a lot of server applications that did big amounts of string handling. I tried to convert some of the code from TCHAR* tp std::string, but the performance was too bad.
Ok, STL is good for many things, but not everything
- Anders
Money talks, but all mine ever says is "Goodbye!"
http://SourceLocker.net[^] SourceControl and DefectTracker Project.
nsms@spyf.dk <- Spam Collecting
|
|
|
|
|
Taking a clue from a recent soapbox rant, I think the simplest thing to do is tell everyone that "STL will fix your problem".
Marc
STL, a liability factory - Anonymously A doable project is one that is small enough to be done quickly and big enough to be interesting - Ken Orr
Latest AAL Article
My blog
|
|
|
|
|
If you have VC++ SP5, there is a file called Vcredist.exe which contains all the files you need.
|
|
|
|
|
So, what about static linking? Saves you all that grief.
Marc
STL, a liability factory - Anonymously A doable project is one that is small enough to be done quickly and big enough to be interesting - Ken Orr
Latest AAL Article
My blog
|
|
|
|
|
Really simple question here, I guess... what's the difference between the following:
#include <iostream>
and
#include <iostream.h>
??
I know that they are two different files in the Visual C++ include folder, but what is the difference from a programming point of view? This is also the same case for some other header files, such as <string> and <string.h>... So which method is more efficient?
Thanks.
|
|
|
|
|
Including <iostream.h> uses the obsolete iostream library. Including <iostream> uses STL. You should always use the STL version since that's the current official library.
--Mike--
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
Latest art~!@#2rDFA#@(#*%$Rfa39f3fqwf--=
NO CARRIER
|
|
|
|
|
Hello All,
I am new to Visual C++. I need to know what is the easiest method of DIGITAL WATERMARKING using Visual C++. Is it the "LSB WATERMARKING" method? I am doing this as part of my school project. The picture format i am doing is BITMAP.
I hope someone can help and guide me (algorithm, methods, programming, etc) to do this.. or provide me with any reference (website, files, examples).
Thanks a lot..
Thong
twh81@tm.net.my
...
|
|
|
|
|
I've had a hard time figuring out the handle to the window that places the low diskpace notification icons on the tray. The goal is to remove the icon. Anyone with an idea?
|
|
|
|
|
Visual C++ 6.0 ----- WindowsXPpro ----- Access2000
I created a database by Access2000 ...... "QLBH.mdb"
CMy3View is CRecordView based class
I put MS ADO Data Control v6.0 and MS DataGrid v6.0 on my form (IDD_DB_FORM)
in design-time , I connect ADO control with "QLBH.mdb" and
MS DataGrid bound to ADO control
In Tab "Connection" when I push "TestConnection" button >>
it show "Test Connection Succeeded" Msgbox
My connection string look like this:
DBQ=F:\Project\QLBH.mdb;DefaultDir=F:\Project;Driver={Microsoft Access Driver (*.mdb)};DriverId=25;FIL=MS Access;FILEDSN=D:\Program Files\Common Files\ODBC\Data Sources\11111.dsn;MaxBufferSize=2048;MaxScanRows=8;PageTimeout=5;SafeTransactions=0;Threads=3;UID=admin;UserCommitSync=Yes;
but in rum-time ADO control is disabled => no record in MS DataGrid.
>> I want MS DataGrid show all my records....then users can edit,add,delete ...
like Access
and the last question: can I connect to my database in runtime
...such as when I user push a other button... ADO control is
connected to "c:\QLBH2.mdb"
thanks
|
|
|
|
|
I want a modal dialog to perform some tasks after it is shown on the screen. Is there a way to achieve this?
Can you please tell me how?
Thnxx
|
|
|
|
|
you could use a one-time initialisation on ON_WM_SETFOCUS( ) event!
Don't try it, just do it!
|
|
|
|
|
Set a timer for 100 msec.
HPS HwndSpy - GUI developer's aid to visually
locate and inspect windows. For the month of August
only, use coupon code CP-81239 for 30% off.
|
|
|
|
|
I want to restart my MFC dialog application at run time - i.e. to close the dialog box and create it immediately after that. Any suggestions how to this? Thanks.
|
|
|
|
|
You can call CreateProcess in your CMyApp::ExitInstance
But why do you want this?
Arjan.
|
|
|
|
|
Hi, how I can response the system message, when my program is in a loop?
(for instance in a 'for' loop). I want to not use Timer & Thread programing.
DoEvent is a function of Visual Basic.
Thank;)
|
|
|
|
|
when you get a system message, you'll get it as WM_SYSCOMMMAND message on your window!
for a window, you normally have a main loop, which calls GetMessage, TranslateMessage and DispatchMessage!
this loop calls you window procedure!
that means, when you're out of your for loop, the window's message queue will be processed, also the syscommand!
Don't try it, just do it!
|
|
|
|
|
|
GDI+ initialization wrecks up DDE file opening in my MDI application (i.e. when you click on the document file in the Explorer). When I call GdiPlusStartup(...) before CMDIFrameWnd::LoadFrame in CMyApp::InitInstance , it says "Windows cannot find the file: ..." at first, the application shows no window, but it stays running and loads document properly at second attempt. When I initialize GDI+ after CMDIFrameWnd::LoadFrame , the document loads properly but the whole frame goes background.
It seems that nasty GDI+ hidden window demolishes DDE window order or something alike. I tried it on the pure AppWizard-generated MDI sample and it's exactly the same phenomenon. I may send the sample if you have any ideas.
Regards,
BB
|
|
|
|
|
i have created a custom tree control and created a group box to contain its location within in my dialog
here is the code
GetDlgItem(IDC_ZONETREE_FRAME)->GetWindowRect(frameRect);
zone_tree.Create(WS_VISIBLE|TVS_HASLINES|TVS_LINESATROOT|TVS_SHOWSELALWAYS|TVS_HASBUTTONS , frameRect, this, IDC_ZONETREE);
however when i run the program the tree control is like an inch below the group box is there something wrong with my code or whats the deal here ?
|
|
|
|
|
Try this:
GetDlgItem(IDC_ZONETREE_FRAME)->GetWindowRect(frameRect);
ScreenToClient(&frameRect);
zone_tree.Create(WS_VISIBLE|TVS_HASLINES|TVS_LINESATROOT|TVS_SHOWSELALWAYS|TVS_HASBUTTONS,
frameRect, this, IDC_ZONETREE);
HPS HwndSpy - GUI developer's aid to visually
locate and inspect windows. For the month of August
only, use coupon code CP-81239 for 30% off.
|
|
|
|
|
The previous answer is right, but the reason you need the ScreenToClient() call is that GetWindowRect() returns the coords relative to the screen, but Create() takes coords relative to the dialog's client area.
--Mike--
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
Latest art~!@#2rDFA#@(#*%$Rfa39f3fqwf--=
NO CARRIER
|
|
|
|
|
would like to have your point of view about a really weird behaviour with my popup menu on XP (Desktop properties => Menu Fade effect). I only use CMenu to create the popup menu.
I coded a very simple MFC program to display a popup memu when the left mouse button is pressed.
So I back and forth between my App (Left button) and the desktop (right button)and after a while the menu doesn't display fine.
(http://home.comcast.net/~llaissus/MFCMenu.jpg)
(http://home.comcast.net/~llaissus/MFCMenu2.jpg).
I just get the shading for the whole menu sytem on XP.
I have to click again in my app to get a good display. If I didn't do that I have to reboot my PC to fix that. (It seems like when you put break point in WM_DRAWITEM).
Note It works fine with Menu Scroll effect or no menu effect.
I think it's a problem of timing but I don't know why
I did that and it works better
LRESULT CALLBACK NewMenuHook(int code, WPARAM wParam, LPARAM lParam)<br />
{<br />
return CallNextHookEx(HookOldMenuCbtFilter, code,wParam, lParam);<br />
}<br />
<br />
<br />
BOOL CMFCMenuApp::InitInstance()<br />
{<br />
<br />
HookOldMenuCbtFilter = ::SetWindowsHookEx(WH_CALLWNDPROC, NewMenuHook, NULL, ::GetCurrentThreadId());<br />
<br />
.../...<br />
}
Code .NET:
http://home.comcast.net/~llaissus/MFCMenu.zip
Has anyone any idea ?
Is it a XP bug ?
Regards
|
|
|
|
|
Am replying according to the snapshots you sent, cuz I encountered such weird effect before and it mya be the same problem.
I have encountered this problem when I was making an owner draw menu, which I guess you are making one as well. According to the MSDN you shall save the DC state that is passed to you in the DRAWITEMSTRUCT struct and restore it back.
I found that this is simply calling SaveDC and RestoreDC. Follwing is the code i used:
void CMainFrame::OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct)
{
if(nIDCtl == 0)
{
CDC dc;
dc.Attach(lpDrawItemStruct->hDC);
dc.SaveDC();
.
.
.
dc.RestoreDC(-1);
dc.Detach();
}
}
When added this lines it did solve the problem and menus didnt show this effect anymore, so I hope this solves your problem.
|
|
|
|
|
Dear all
I have made an application in MFC using VC++ version 6.0 for Windows
2000 which uses Shell_NotifyIcon to show icon on the status bar. I have
made this application as a NT Service. (ie. the code of service is in
the MFC application only).
Purpose of application:
........................
The purpose of application is that when we run it as a service, an icon
appears in system tray and currently the window corresponding to it is
hidden. When we double click the tray icon the window corresponding to
it is shown. (ie I call ShowWindow(SW_RESTORE) to show the window .)
Problem
........
The program works fine across reboots but gives problem during log
off/log on. When we logg off the system and then login, the icon in the
system tray is shown . But this icon is not responding at all. ie. if
we click double click on it then no event is called and the window is
not shown.
I think we have to refresh the system tray task bar after logon OR may
be there some problem in the service.
Can anybody please suggest a way out. Thanks in advance.
|
|
|
|