|
in theory, they will all work equally well. depending on how items are added and removed and managed in your application, one may work better than the other. you'll have to pick the one that fits best with your app.
-c
ABSURDITY:
A statement or belief manifestly inconsistent with one's own opinion.
|
|
|
|
|
that std::map choice, is that something where you can add a string and then retrieve it again using an index number? if so, do you have documentation on it?
Thanks
|
|
|
|
|
yes. a map allows you to create key/value pairs. the key and value can be of any type (int and string, or int and pointer, string and int, etc.)
there are probably a few articles here on std::map. if not, there are samples in MSDN.
-c
ABSURDITY:
A statement or belief manifestly inconsistent with one's own opinion.
|
|
|
|
|
Does anyone know why pressing "ENTER" closes a dialog-based MFC application ? And I removed all controls, if someone thinks of that ...
Even with controls, if I "ENTER" text in a text control closes the application.
|
|
|
|
|
Override OnOK and delete all the code inside it.
|
|
|
|
|
override PreTranslateMessage. add this code:
if ((pMsg->message == WM_KEYDOWN) && (pMsg->wParam == VK_RETURN))
{
return TRUE;
}
-c
ABSURDITY:
A statement or belief manifestly inconsistent with one's own opinion.
|
|
|
|
|
Read this article :-
http://www.codeproject.com/useritems/pretransdialog01.asp
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
Hi
Is there a tool with which I can find all the bmp file in one directroy (include the bmp file in exe ,dll)?
Thanks
benben
|
|
|
|
|
ive written a tool a long tima ago in vb that searchs ALL files ina directory for bitmaps and extracts them:
Type BITMAPFILEHEADER
bfType As Integer
bfSize As Long
bfReserved1 As Integer
bfReserved2 As Integer
bfOffBits As Long
End Type
Private Sub cmdExtract_Click()
c = 1
a = 1
OO = 1
Dim FileHeader As BITMAPFILEHEADER 'Bitmap file header structure
myname = Dir(txtPath & "*.*")
Do While myname <> ""
a = 1
OO = 1
Open txtPath.Text & myname For Binary As #1
Dim ss As String
ss = Space(LOF(1))
Get #1, , ss
Do While a <> 0
a = InStr(OO, ss, "BM", vbBinaryCompare)
If a = 0 Then Exit Do
Get #1, a, FileHeader
If FileHeader.bfSize < 350000 And FileHeader.bfSize > 150 Then
OO = a + FileHeader.bfSize
bmp1 = Mid(ss, a, FileHeader.bfSize)
c = c + 1
FullPath = txtDest.Text & "pic" & c & ".bmp"
Open FullPath For Output As #2
Print #2, bmp1
Close #2
Else
OO = a + 1
End If
Loop
Close
myname = Dir
Loop
Close #1
End Sub
make a textbox call txtPath that you'll put the dir to search and another called txtDest for the directory to extract to, and button called cmdExtract to start extraction .
its the worse way to do it, but it works rather well
|
|
|
|
|
Hi,
I have a dll ,which works fine in debug mode & it doesn't in release mode.How can i make the release build to work properly?.THe OS i work on is WIndows ME.
Regards
Neha
|
|
|
|
|
intialize all variables. check all pointers for out of range conditions.
you can also put debug symbols in your release build to see what happens: 1. turn off optimizations in Project / Settings / C/C++ 2. put debug symbols in the DLL from Project / Settings / Link.
-c
ABSURDITY:
A statement or belief manifestly inconsistent with one's own opinion.
|
|
|
|
|
HI FRIEND
There may be bcz of many facts...
in debug mode most of the assertions are skipped and they dunno show any errors..for example in many situations the buffer overflow is not reported by the DEBUG mode..but the same will cause some assertions in release
look in to the project>settings>link tab and make sure that all of the .lib files u linked in the time of DEBUG is also included in release..
i think u can get it now...
Trace The Bugs...
|
|
|
|
|
Dear All,
In a dialog-based application i have menu and some toolbars, now
i also want to add the status bars into the project. How should
i do?
Thanks in advance!
chen
|
|
|
|
|
Add a CStatusBar member to your dialog.
Now call Create or CreateEx in the OnInitDialog.
You can use GetStatusBarCtrl to get the underlying CStatusBarCtrl and call SetText on that
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
Nish, I added a CStatusBar to the dialog, and call Create in the OnInitDialog, like this:
m_ctlStatusBar.Create(this);
Then I added a line of code:
m_ctlStatusBar.SetIndicators(indicators, 4);
which contains the cap, num, scrl standard status panes.
then in OnPaint, I did this:
CStatusBarCtrl& ctl = m_ctlStatusBar.GetStatusBarCtrl();
ctl.SetText("Status", 0, SBT_NOBORDERS);
but nothing happened. What did I miss?
thank you a lot in advance!
(hey, one thing I couldn't figure out is that how you post messages when it is night your time? you sleep very little? )
|
|
|
|
|
Dear Lucy,
You are correct. It won't give you a status bar that way. I have written an article that shows how to add a status bar to an MFC dialog based app.
http://www.codeproject.com/useritems/dlgstatbar01.asp
I hope that helps
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
We as programmer often need collecting many information from the web. iBee is such a good tool let programmer save exact content from the web, yes, you need save the content you don't want such as Ads Picture, Frames. just select the content you want and drop it, you will get what you want. What's more, you can edit the content in Internet Explorer! and then build all articles into a eBook in CHM Format.
iBee is especially optimized for codeproject users, iBee will download all zip or exe file.
if you give me some advices, I will give you a copy of iBee free, thank you.
you can find this cool tool at www.justdosoft.com/iBee.
|
|
|
|
|
If you want to advertise on Codeproject, then pay money for a banner like everyone else does.
STL is a religeon. Enquiries to Reverend Christian Graus
|
|
|
|
|
If you want to advertise, do it the correct way and buy a banner!
We saw your add yesterday, and we are going to ignore this one just the same.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
this isn't an appropriate way to advertise your product. pay for your ads, like everyone else.
-c
ABSURDITY:
A statement or belief manifestly inconsistent with one's own opinion.
|
|
|
|
|
Well I be(e) darned, another freeloader!
Free advertising might be good sometimes and in some places (for the advertiser, it's almost alwas just an annoyance for the poor souls happening to see it).
As you have by now hopefully been aware this was neither the time nor the place for it.
For the ones disliking annoying ad-gifs and crap, why not use JunkBuster? It's GPL and can block just about anything you want. There's a SourceForge project called ijbswa (IIRC) that runs it in the tray and adds fun stuff as perl-compatible regexp to replace page contents on-the-fly. Make e.g. /. look like CP?
|
|
|
|
|
If you really want to give it away for free, why not post it here on CP in the Free Tools section. Articles there do not have to include the source code, but source code is really appreciated.
---
CPUA 0x5041
Sonork 100.11743 Chicken Little
Orgasms are universal!! -- Mike Mullikin in The Lounge 21:27 15 May '02
|
|
|
|
|
hi
dose anybody know how i would go about setting up a WINSOCKS connection between 2 PC's in a network using Visual c++.
I just want to be able to send message to connect, send data and close connection.
Any code would be really helpful.
thanks
|
|
|
|
|
If you have Platform SDK installed with samples, go to C:\Program Files\Microsoft SDK\Samples\NetDS\WinSock\Simple (or to folder where you have installed it). Two files - simplec.c and simples.c - are examples you would like to see.
Martin
|
|
|
|
|
i dont have acess to these files as it's a university computer
|
|
|
|