User Profile

Collapse

Profile Sidebar

Collapse
DumRat
DumRat
Last Activity: Jun 5 '08, 09:28 AM
Joined: Mar 9 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • DumRat
    started a topic BitBlt trouble.
    in C

    BitBlt trouble.

    Hi,
    Can anyone plz help?
    I have the following code for the WM_PAINT event, but it doesn't work. Need to knw why. I'm drawing the scene to the window, but am using an intermediate DC. Then it just shows a white screen, however, if I drop the intermediate DC, it works. I need to know why this fails. Thanks in advance.

    Code:
    case WM_PAINT:
    		{
    		HBITMAP hBm = (HBITMAP)LoadImageA(NULL, "black.bmp",
    ...
    See more | Go to post

  • DumRat
    replied to size of returning pointer
    in C
    You can't. Return an object instead. Or pass another param by reference
    to the function to get the size. I don't know which is the better of these two methods....
    See more | Go to post

    Leave a comment:


  • DumRat
    started a topic Displaying .bmps on screen + BitBlt problem
    in C

    Displaying .bmps on screen + BitBlt problem

    Hi,
    I want to run an animation(in essence). I want to draw multiple images (possibly .bmps, but I'd like other formats as well.) on to the screen each frame.
    I tried to do this with some C++ code, but it isn't working as it should (As I'm expecting it to I guess.). Can anyone please help me?

    Here's the class definition. Just for the variables.
    Code:
    class CWorld
    {
    private:
    ...
    See more | Go to post

  • DumRat
    replied to pointer.
    in C
    The whole point of pointers is not to work with the actual data, but work with a proxy for that data. As in the parliamentary system. :)
    But you can access the actual data anytime you need via a pointer to that data.
    See more | Go to post

    Leave a comment:


  • DumRat
    replied to Problem in inserting values in map.
    in C
    macho,
    Do follow the naming conventions, it's a little hard to read your code at first.
    What are the compilation errors?...
    See more | Go to post

    Leave a comment:


  • DumRat
    replied to Problem in choosing data structure
    in C
    But this is the point. Say u have

    {A,B}, {A,C}, etc.

    If u use the first character as the key, you can only have one of these in the map. So u can't use a map like that. The other alternative is to use a multimap - but then, if you had 25 pairs starting with A, you'd have to traverse through that entire 25 elements to find your element - which is inefficient. The best method then is to use both the characters combined...
    See more | Go to post

    Leave a comment:


  • DumRat
    replied to What is wrong with this?
    in C
    Looks like I've been living a lie. Thanks for clearing things out a little. Anyway, I changed the functions a little so that no "Cheat" type of optimizations aren't possible. Even then .NET was faster. Thanks
    See more | Go to post

    Leave a comment:


  • DumRat
    replied to What is wrong with this?
    in C
    1.The CLR code takes more time to load and initialize - Is this where the preallocation is done?
    2. If that is the case, how can i actually test the 'real' performances?
    3. According to you guys, if I were implementing a iterative deepening depth first search using stacks(Say, for 8-puzzle) in both native C++ and CLR, what would be more faster? I always thought that native CPP is faster - if so, by how much?

    Thanks for...
    See more | Go to post

    Leave a comment:


  • DumRat
    replied to Problem in choosing data structure
    in C
    Suppose you want to check if there's a certain character pair {X,Y} in the map?...
    See more | Go to post

    Leave a comment:


  • DumRat
    replied to Problem in choosing data structure
    in C
    WeaknessForCats << On the above problem I guess your method is the best. But say the set of character pairs are like this :

    {A,B}, {A,E}, {A,F}, {C,K}, {C, G}, ....

    Now can a map be used in the way you have indicated?
    See more | Go to post

    Leave a comment:


  • DumRat
    replied to What is wrong with this?
    in C
    Timing?

    I used timeGetTime() for the console app, you know, with timeBeginPeriod () at the beginning. And used DateTime::Now.T ickCount for CLR...
    See more | Go to post

    Leave a comment:


  • DumRat
    replied to Problem in choosing data structure
    in C
    You can use a vector of maps to store your data. But you have to organize the data into a structure I guess.

    ex:

    Code:
    struct TwoLetters
    {
       char first;
       char second;
    
       //Overload the operator < or > here. There's another way with a function, but I haven't tried it. Let's say that you overloaded the < (less operator).
    };
    Now, you...
    See more | Go to post

    Leave a comment:


  • DumRat
    started a topic What is wrong with this?
    in C

    What is wrong with this?

    Hi,
    I'm confounded. Can anyone please help me? Here are two pieces of code.

    This is C++.NET code.
    Code:
    void CLRStackTest()
    {
    	int i = 0;
    	Stack<int> clrstack = gcnew Stack<int>();
    	for(i = 0; i < 1000000; i ++)
    	{
    		clrstack.Push(i);
    	}
    
    	while(clrstack.Count > 0)
    	{
    		clrstack.Pop();
    	}
    }
    ...
    See more | Go to post

  • DumRat
    started a topic Managed or unmanaged?
    in .NET

    Managed or unmanaged?

    Hi guys, I'm new to .NET, can anyone tell me if this code is managed or unmanaged(Whate ver that means)?

    Code:
    #include <vector>
    
    using namespace System;
    using namespace std;
    
    class H
    {
    private:
    	std::vector<int> x;
    
    public:
    	void Add(int y)
    	{
    		x.push_back(y);
    	}
    };
    
    int main(array<System::String
    ...
    See more | Go to post

  • DumRat
    replied to Double clicking
    in C
    You sure that dbl-clicked highlighted content go to clipboard? Wikipedia says that UNIX does that, but it does not mention anything like that about windows. I do apologize, I have tried, but had little luck finding resources on this topic....
    See more | Go to post

    Leave a comment:


  • Have you tried doing it? Post where exactly you are having trouble. No one will write the code for you.
    See more | Go to post

    Leave a comment:


  • DumRat
    started a topic Double clicking
    in C

    Double clicking

    Hi,
    I have this question which gives me nightmares these days. I need to make an application which can get the highlighted text in any window. Ex: When I run my app, and when I dbl click any word in notepad(say), the highlighted word should be available to my app.
    I am talking in Win32 of course. There is one way that I found out. It uses a mouse hook, and on a dbl-click event, send a WM_COPY command to the foreground window,...
    See more | Go to post

  • DumRat
    started a topic How large requests are handled in Apache

    How large requests are handled in Apache

    Hi,
    I really have to know how data is received by the Apache server. For example, how is a POST request is handled with a large amount of data? Does the receive function just forward whatever it receives? Is there a limit to the number of bytes ap_read_request function (I hope that I am right in saying that this is the function that is responsible for reading in a request.) can read, if there is, how does the server handle a request...
    See more | Go to post

  • DumRat
    replied to Genetic algorithm Problem
    in C
    Can anyone help please?
    See more | Go to post

    Leave a comment:


  • DumRat
    replied to rand() and threads
    in C
    So, I'll try my hand at a rand function of my own then. Thanks.
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...