|
I know one site that does have some very cool examples to learn from:
http://nehe.gamedev.net/
I hope that helps!
|
|
|
|
|
hi,
yeah i appreciate your advice but i have already gone throught that site and i think that it is not having anything relating to access the data of the image after reading the image...that's wht i actually want
thanks,
pavan.
Pavan Kumar N Tiruveedhula
2382 Duncan Dr #4
Fairborn, Ohio-45324
1 (978) 473-1244
|
|
|
|
|
Hi,
On a similar note, I am also have trouble accessing a .bmp image. This is what I have got so far,
Let file.bmp be the target .bmp file. It can be accessed as follows,
---------------------------------------------------------
BITMAP bm;
HBITMAP hbitmap = (HBITMAP)::LoadImage(NULL,"file.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);
GetObject(hbitmap,sizeof(BITMAP), &bm);
--------------------------------------------------------
The above 3 lines gets you from file.bmp to a BITMAP data structure you can access and manipulate. The BITMAP data structure can be seen at MSDN via http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/bitmaps_2h6a.asp
BITMAP is just a struct, not a class, and so is accessed directly.
The above lines require #include <windows.h>
I was able to get to the BITMAP data structure, but have yet to decode what everything in the data structure means. This is not much, but it's a start.
Any additional help on the data structure would be greatly appreciated. Thanks in advance.
Victor
|
|
|
|
|
Hi to all in bit crunch land.
I am not very advanced with the VStudio.net platform so don't fall over hurting yourself laughing that this!
I am trying to polish off a program that will read an .ini file for its parameters and locate a registry key value based on these parameters and replace the subject key with the supplied data.
The problem I seem to have is in using a pointer to the key value in the statement: lRet = RegOpenKeyEx(HKEY_LOCAL_MACHINE, reg_key_tree, 0, KEY_QUERY_VALUE, &hKey);
reg_key_tree is defined as: char reg_key_tree[1024];
lRet returns a 2 on this branch unless I have previously opened the registry on the same machine using the desktop GUI and then it returns the 0 for ERROR_SUCCESS. Once the registry has been opened, this program always works. I have reviewed code from Microsoft and on the face of it, it should work.
If I compile the program with the reg_key_tree variable written out and surrounded in quotes, it always works regardless if the registry had been opened in any other window.
Can someone teach an old dog this new trick? Thanks in advance.
Carpetbagger
|
|
|
|
|
Check my article about the little windows utility.
There you will find everything you can do with the win registry.
gabby
|
|
|
|
|
hello,
if i m not wrong ur problem is when
char *reg_key_tree = "Software\\microsoft\\etc"
lRet = RegOpenKeyEx(HKEY_LOCAL_MACHINE, reg_key_tree, 0, KEY_QUERY_VALUE, &hKey);
and when
lRet = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "Software\\microsoft\\etc"
, 0, KEY_QUERY_VALUE, &hKey);
there is no prblm.
well, i tried out this with my application. there is absolutely no problem. check out ur pointer def...
ask_you
|
|
|
|
|
In Ada, the coder can access the first and last values of an enumeration using attributes as follows:
Some_Enum'FIRST
Some_Enum'LAST
No matter what the enumeration or type, the first and last values are returned.
Is there an equivelent ability in C/C++?
|
|
|
|
|
That is not built into C++, you can simulate it with something like:
enum EColors
{
_firstColor,
Red, Blue, Orange, Mauve
_lastColor
}; Then to test whether a number is in the allowable range you test (n > _firstColor && n < _lastColor) I find it easier to do tests when the sentinel values are not legal enum values. If _firstColor were the same as Red , and Mauve the same as _lastColor , you also introduce a maintenance problem because you (and any other devs) have to remember to keep the definitions of _firstColor and _lastColor in sync with the enum values.
--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
----
I even hear the Windows "OMG I booted up fine" sound.
-- Paul Watson diagnosing hardware problems.
|
|
|
|
|
Hello,
is there an option to always display the CTreeView Open, or expanded... i don't want to see the +, i want to see all the sections.
thanks!!
|
|
|
|
|
Hi!
I know how to load a bitman from a bitmap resorce, with the CStatic::GetBitmap function, but i don't know how to load a bitmap from a file.
any ideas?
thanks!!
|
|
|
|
|
Check the LoadImage function.
example:
HBITMAP hBmp = (HBITMAP)LoadImage( NULL, pcszFileName, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE );
|
|
|
|
|
|
I have problems with a 32-bit client, a 64-bit server and a 32-bit server. These applications use sockets.
The applications were written in Visual C++ 6.0 and I use the Microsoft Platform SDK SP1 to compile the server code for the Itanium 64-bit platform.
It seems that sockets in 64-bit behave quite different than sockets in 32-bit. For example when I execute 20 clients trying to connect 100 times to a server this is what happens:
30% of the connections from the 32-bit clients to a 64-bit server fail, whereas on 32-bit it is less than 5%.
The server code is 32-bit and 64-bit compliant. So when i need the server in 32-bit i just compile it for 32-bit and the same with 64-bit.
Another problem that i'm having in 64-bit is that sometimes clients say they were connected but the 64-bit server does not accept their connection.
Any one with ideas?
Thank you very much.
|
|
|
|
|
First off, what I/O model? Secondly, describe more about what you mean by server not accepting connections.
Kuphryn
|
|
|
|
|
I'm creating a large string with CStringto be inserted in an web browser.
I'm mostly concatenating tags and text in the string, eventually, the string will become quite large, and performance will suffer a bit.
is using std::string faster ? if I use std::string::reserve to reserve some memory, even if it's really too much for small buffers, will that make operations faster ?
Also, I'd prefer not having to go back to C strings.
my "builder" class is something like
class Builder
{
CString sBuffer;
void beginRow() { sBuffer += "<tr>";} ;
void endRow() { sBuffer += "</tr>"; };
}
with some other basic html tags methods ...
Thanks.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
certainly pre allocating buffer will increase performance regardless of which class you use.
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
well, after some experimenting, seems that the problem is calling my Builder class.
If I create the string locally and send the whole shebang to the Builder class instead of using the Builder class to ease the work of me and other programmers, it goes way, way faster.
Is there a way to reduce the overhead of function calling, inlining the methods does not seems to do much, and I would like not to be forces to use MACRO.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
I do not think that the function calling is your problem.
Do you by chance pass strings around by value? That would cause frequent allocation / copying of the strings' content, an THAT will hurt you.
Do you use a profiler to find where the time is spent?
-----------------------------
Get trial copy of comment generating tool CommentMakerPro, std::string and std::string containers viewer FeinEvaluatorPro and windows manager for Microsoft Visual Studio .NET FeinWindows at www.FeinSoftware.com
|
|
|
|
|
I am writing a DDEML program that also runs a MQ client program within it. The MQClient reads from a remote queue and i am trying to write the data read to an excel file using DDEML. I am using DdePostAdvise to call DdeCallBack Function that writes to the Excel file. But the DdePostAdvise is not working properly. Does anyone have a clue on how to do this?????? Please let me know
|
|
|
|
|
Dear All,
I am a novice in C++ programming (or any kind of programming). I am
teaching myself C++ these days mainly to run some mathematical models.
I am using a PC at home (windows millenium).
In order to simulate the models, I need to draw graphs, mainly a set
of numerous connected line segments, also I need to be able to plot
points. I am using Microsoft Visual C++ 6.0. Actually I don't even know
how to create a new window where I can do all these graphings and
don't know which commands to use.
Could someone kindly email me a complete code in visual C++ which
opens a window, draws a set of say 10 connected line segment (if in color, it would be great) and plot a point. I am sure that this is a fairly easy matter. I will very greatly appreciate any help. You will save m A LOT of time. And I will be greatful if you email me at ali_nabavi2000@yahoo.com
Kind Regards,
|
|
|
|
|
Check out the articles collection here. There are a number of graphing apps available. You may find one that works for you, or that can be easily adapted to your use. It's very unlikely that anyone will write one for you, though.
Some people think of it as a six-pack; I consider it more of a support group.
|
|
|
|
|
|
i think its better if u can go through the tutorials of NeHe site for graphics.
http://nehe.gamedev.net
Pavan Kumar N Tiruveedhula
2382 Duncan Dr #4
Fairborn, Ohio-45324
1 (978) 473-1244
|
|
|
|
|
I keep getting that message when closing my application (haven't tested in release version yet though).
Is there a way to figure out which thread that exactly is, and why it exists with code 3?
|
|
|
|
|
Try using Debug/Threads on the IDE Menu when debugging your process.
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|