|
If you want to support the For Each syntax in VB your collection must implement _NewEnum. You might want to check out ATL's IEnumOnSTLImpl which can take care of almost all of it for you. You can also check out this link[^] that has another example that uses CComEnum which can also be helpful.
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
|
|
|
|
|
Dear Everyone,
This is my first question in this message board.I am not sure
whether the title is suitable for my question or not but by reading
my message, I guess that you can understand my problems.
I have created a simple program which retrives data written in
an .ini file(actually any text file will do).The data retrieved from the file
will be displayed at the combo box.I have created this part.
The problem here is that I want to hide the information written in the .ini
file from the users(Sometimes, there are information which we don't want the users to know).The user can update the application by downloading a new .ini file from a web side.In short,the update of the software only deals with the .ini file.
I think that most people will encrypt the .ini file and decrypt it
before loading the data into the combo box.I would like to do it in this
way but I don't have enough knowledge.I want to decrypt the encrypted .ini file into a buffer because if I decrypt the encrypted .ini into a file,
the user might see it.
Is there any other ways to do this?I just want to
1)Hide the .ini file content from the user and at the same time, I need to retrieve data from the file and display it at the combo box.
2)I want to update the .ini file.
Helps are needed.
Thanks alot.
From Joji.
|
|
|
|
|
You can look into the windows crypto API (which is a bit complicated but very complete).
Also you should look up blowfish encryption, there are a few free implementations on the internet that will allow you to encrypt and decrypt buffers in memory.
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!
|
|
|
|
|
How can I add Toolbar button event handler in VC++ 7.0?
I can't find it.
|
|
|
|
|
Is there a quick and easy method to place an image into a dialog box? I just got a request from a client to add thier company logo (provided as a bmp) onto a dialog box the gets data from users at said company. I just want to display the logo on the dialog. Any suggestions?
---------------------------------------------
The greenest grass is NOT on the other side of the fence, its the grass you take care of. Have you watered your lawn lately?
|
|
|
|
|
Yes, use a static control with the bitmap style. In the VC 6 resource editor, it's called a "picture" but it's just a static under the hood.
--Mike--
"I'd rather you just give me a fish today, because even if you teach me how to fish, I won't do it. I'm lazy." -- Nish
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
okay... i did that... except I apparently missed just how to link the control to the bitmap I want... sorry to ask for a walk through, but its late and I'm not entirely clear headed at this point
Thanks and Thanks
-Mel
---------------------------------------------
The greenest grass is NOT on the other side of the fence, its the grass you take care of. Have you watered your lawn lately?
|
|
|
|
|
Mel Feik wrote:
I apparently missed just how to link the control to the bitmap I want
Add your bitmap as a resource to your project and give it an ID like IDB_LOGO or whatever you like. Then in the properties dialog for the static control that you added, you will be able to select the IDB_LOGO resource, and that will link your bitmap to the static control.
Good Luck
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!
|
|
|
|
|
thanks
---------------------------------------------
The greenest grass is NOT on the other side of the fence, its the grass you take care of. Have you watered your lawn lately?
|
|
|
|
|
I'm somewhat embarrassed to ask this, but as I said I've not done this before. I goofed this up somehow and ended up with a hex file instead of my bitmap.
---------------------------------------------
The greenest grass is NOT on the other side of the fence, its the grass you take care of. Have you watered your lawn lately?
|
|
|
|
|
On the control's properties there is a Type combo (set it to Bitmap) and an Image combo (set it to the resource ID of the bitmap to show). You can also set the bitmap at runtime with the STM_SETIMAGE message.
--Mike--
"I'd rather you just give me a fish today, because even if you teach me how to fish, I won't do it. I'm lazy." -- Nish
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
thanks again
---------------------------------------------
The greenest grass is NOT on the other side of the fence, its the grass you take care of. Have you watered your lawn lately?
|
|
|
|
|
If the bitmap doesn't use the 16 standard colors, I'd recommend CWndImage[^] (if you use MFC)
deals with pixel-vs-dialog units size and palette issues.
Auch den Schatten will ich lieben weil ich manchmal lieber frier' Rosenstolz [sighist]
|
|
|
|
|
Thanks to all replies. I must have just been over tired last night. Didn't have any problems with it today and I appreciate the help.
-Mel
---------------------------------------------
The greenest grass is NOT on the other side of the fence, its the grass you take care of. Have you watered your lawn lately?
|
|
|
|
|
Are there any other good C++ forums that you know about. I mean the Forums like Sun has for java. This one is good but still there may be others........
|
|
|
|
|
I think that programmers heaven is decent (at times) so you might want to check that out.. has seperate forums for C/C++ w/ and w/o MFC.
http://programmersheaven.com/zone3/index.htm[^]
---------------------------------------------
The greenest grass is NOT on the other side of the fence, its the grass you take care of. Have you watered your lawn lately?
|
|
|
|
|
Programmer's heaven is ok but i could have been better. I was using the Java Forum hosted by Sun http://forum.java.sun.com/, it's real great
|
|
|
|
|
www.codeguru.com is another good one. It has java forum maybe you are interested.
David
|
|
|
|
|
Check out
Experts Exchange
http://www.experts-exchange.com
|
|
|
|
|
For core C++, you can't go past comp.lang.c++ on usenet.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
hi, i've written a simple application that display a sequence of bitmap in the VIEw of a MFC/SDI application.
There're four components to the implementation:
(1) timer itselg
(2) View_Class::OnTimer(..)
{
Invalidate(); //Trigger View_Class::OnDraw()
(3) View_Class::OnDraw(..) is responsible for rendering the bitmaps to screen.
(4) Document class - handles all bitmap loading
(4a) Constructor:
STEP 1: Pre-load a few frames
STEP 2: launch a thread - LoadFrames( ) - that load the rest of the bitmap sequence.
hThread = CreateThread( NULL, 10000000, (LPTHREAD_START_ROUTINE) LoadFrames, this, 0, &nThreadID);
As you can see, I did allocated 10MB worth of memory here!
STEP 3: set timer
(4b) LoadFrames( ) //This method loads a bunch of frames to document class
{
//ERROR!!
hBitmap = (HBITMAP) ::LoadImage(AfxGetInstanceHandle(), sPath, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE );
if( hBitmap != NULL)
{
pDoc->GetBitmapSeq(i).Attach(hBitmap);
}
else
{
//Out of memory?!?! NOTE: dwError==8 implies "ERROR_NOT_ENOUGH_MEMORY"
//System monitor shows that the thread never had more than 2.5MB!??! How can it run out of memory??
DWORD dwError = GetLastError();
}
}
Thanks
norm
|
|
|
|
|
Three problems that I can see:- A thread that uses MFC must be created by
AfxBeginThread() . - The stack size parameter has no effect in this situation, as you're not creating bitmaps on the stack.
- The
HINSTANCE param to LoadImage() must be NULL when using LR_LOADFROMFILE Good luck
--Mike--
"I'd rather you just give me a fish today, because even if you teach me how to fish, I won't do it. I'm lazy." -- Nish
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
thankyou... i tried using CAnimateCtrl but doesnt seems like it helps..
MCI control is a lot better, especially with memory requirement. But seems like it's a little jerky. QuickTime is the best thus far - which makes me wonder why we need avi in the first place.
norm
|
|
|
|
|
Hi, I launched a thread that's responsible for loading a sequence of bitmap into memory, so, I need a lot of memory for this thread. Here's the code fragment:
unsigned long nThreadID;
HANDLE hThread;
hThread = CreateThread( NULL, 5000000, (LPTHREAD_START_ROUTINE) LoadFrames, this, 0, &nThreadID);
So, as you see, I've allocated 5MB of memory to this thread. However, I keep getting memory allocation error from my thread function:
long WINAPI LoadFrames(LPARAM lparam)
{ //*
...
...
hBitmap = (HBITMAP) ::LoadImage(AfxGetInstanceHandle(), sPath, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE );
if( hBitmap != NULL)
{
pDoc->GetBitmapSeq(i).Attach(hBitmap);
}
else
{
//Out of memory!! dwError==8 implies "ERROR_NOT_ENOUGH_MEMORY"!!?! I really dont understand, I was monitoring the system monitor and the thread has less than 3MB allocated to it.
DWORD dwError = GetLastError();
... more exception handling code...
}
return 1;
} //*
Thanks!
norm
|
|
|
|
|
You are allocating a 5M Stack for the worker thread. Is that what you really want? Where does LoadImage() get its memory from. I doubt that its the stack.
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|