|
Ya exactly..
Reagards
Shiva
|
|
|
|
|
Deriving a class from the CSplitterWnd and override the OnMouseMove, OnLButtonDown, etc and skipping the default call to CSplitterWnd::OnMouseMove, CSplitterWnd::OnLButtonDown, etc., might be a solution.
- NS -
|
|
|
|
|
Hi,
My Code
-------
int key_status=0;
key_status = System::Convert::ToInt32(myReader->get_Item("status"));
While executing the above code i am getting the below error
E:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\xlocnum(965): error C2177: constant too big
Plz some one suggest me to solve it
Thankyou
Know is Drop, Unknown is Ocean
|
|
|
|
|
The first step would be to look at Line 965 of xlocnum and see what constant values it is using and where it is getting them from. One of them is too large. I guess one you've defined rather than one MS defined themselves. To determine which one a breakpoint on the above mentioned lien would certainly be helpful. If you can't get any further you can at least post the result of your investigation. Good luck.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Hi,
I cant able to trace the code. Coz this is an dll, also while building this itself i am getting error.
Know is Drop, Unknown is Ocean
|
|
|
|
|
So you have a built Dll you can't debug even though you have the source, and the source doesn't build so it can't actually be the source the Dll was built with. There are clearly multiple problem here. Take it a step at a time and post details of the errors if you can't fix them. You need to be standing on firmer ground ( more sure of what's happening ) before anyone can give you much help I'm afraid.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Exelioindia wrote: While executing the above code i am getting the below error
E:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\xlocnum(965): error C2177: constant too big
Not possible. C2177 is a compiler error, not a runtime (i.e., execution) error.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
this is a C++/CLI question, asked in the wrong forum...
|
|
|
|
|
Hi,
I am new to windows programming. I want to change the slider bar position of a third party software (using WinAPI only), which I have accomplished by sending message.
SendMessage( aControlHWnd, TBM_SETPOS, (WPARAM) TRUE, (LPARAM) aPosition );
Now, the position of the sliderbar it is changed, but the corresponding values in other objects (like textbox showing the value related to this sliderbar) are not updated.
I can only use Win API and donot have any access to the event handlers, but if the slider is moved manually by mouse the corresponding values in other objects (like textbox showing the value related to this sliderbar) are also changed. So I am assuming that an event handler already exists in the software which automatically updates other related objects.
Now I just need to send the right message to the right handler to accomplish the task.
Any help would be greatly appriciated.
Thanks.
|
|
|
|
|
When you change the position of the slider, some messages will be sent to the parent. If you send those messages by yourself to the parent of the slider in the same manner you did for the slider, I believe you will get what you expected. You can watch the messages using Spy++. WM_HSCROLL or WM_VSCROLL messages will be they. You can identify the message parameters by refering MSDN.
- NS -
|
|
|
|
|
I deal with grayscale images which i convert to 32bit bitmaps to display...
I use CreateCompatibleBitmap () to create bitmap and bitblt () to display bitmap. But if i change the system display settings to other than 32 bit colors i get distorted images displayed
I use following code:
int k = 0;
for (int i = 0; i < bm_info.bmWidth * bm_info.bmHeight; i++)
{
tbmp [k++] = bmp[i];
tbmp [k++] = bmp[i];
tbmp [k++] = bmp[i];
tbmp [k++] = 0;
}
CDC pMemDC, *pDC;
CBitmap *pBitmap = new CBitmap;
BOOL res;
pDC = GetDC();
res = pBitmap->CreateCompatibleBitmap (pDC,bm_info.bmWidth,bm_info.bmHeight);
if (res > 0)
{
pBitmap->SetBitmapBits ( bm_info.bmWidth * bm_info.bmHeight*4,
(unsigned char *)tbmp );
pMemDC.CreateCompatibleDC ( pDC );
pMemDC.SelectObject ( pBitmap );
pDC->BitBlt ( 300 ,15 , bm_info.bmWidth,bm_info.bmHeight ,
&pMemDC ,0,0 ,SRCCOPY );
}
all help appreciated... ( sample code is more appreciated )
Sharath
|
|
|
|
|
Take a look in the site, there is articles to explain it.
If you want independant bitmaps, you should look for info about all this:
<br />
BITMAP bm;<br />
BITMAPINFOHEADER bmInfo;<br />
LPBITMAPINFOHEADER lpBmInfo;<br />
HANDLE hDIB;<br />
HDC hDC;<br />
HPALETTE hPal;<br />
because is needed to transform from one to the other
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Also, you may want to read about palettes and
device-independent-bitmap color tables.
Up-sampling an image to 4 times it's original size just to
display it is....well...kind of a waste of resources.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
But How do I Display grayscale Image... without up-sampling, i need to specify all RGB values to display ( I dont know to wat extent im right)
|
|
|
|
|
I don't remember it correctly, but I know there is a formule that converts from RGB to Grey scaled values. I have seen it in forum, but not shure if here on in "algorithms".
The fact is that you can go through like in a matrix (two "for"s) your image asking for the individual pixels, use GetRGB, apply the formule and then set the new grayed value to the pixel.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
actually wat i get is grayscale image, which i need to display using MFC, and with my little knowledge on MFC, it was takin only RGB values... for the display, u could see that in the code im using.... ,to put my question more specifically wat should i do to display my pixel ... which is only 8bits and i need 24 bit ( which is wat i do in my code).... which was displayin the image but when i change my system setting the display was goin for a toss.... thats the reason i wanted to make it deviceindependent... I hope i have put my question right this time... and thx for the help ( M.D.V)
|
|
|
|
|
Take a look to this link[^]
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Sharath Jagannath wrote: But How do I Display grayscale Image... without up-sampling
Your example was 8-bit grayscale, right? If you make a DIB with that data,
the DIB's color table should have 256 shades of gray, corresponding to the 256
possible pixel values. When you draw the bitmap to a 16,24,or 32-bitperpixel
display, the bitmap pixels will be mapped through the color table and the
resulting RGB value from the table will be drawn on the screen.
You only need to resample if you need to downsample, like to a palette based
video mode. These days, that is rare.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi frnds,
I'm writing an automation application...in that i need to take screenshots of some child windows and of others which are not child windows of a 3rd party application...
For doing this i want to know when that 3rd party app pops up the child window so that i can get the handle and take the screen shot...for this i need to know when the application sends the message to the system that the child window is created...
for doing this i need to track all the messages coming in and going out of the application... since its a 3rd party app i cannot use spy++
Can you guys bail me out of this...
|
|
|
|
|
You may need two things which you can look up on CP and elsewhere. DLL injection and Global Message Hooks. With these techniques you'll be able to intercept all the messages in an application before the application itself even knows about them.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
I hav an idea tht it can be done with Global Message Hooks...but dont how to go about it... because i dont know what messages the application is sending or receivin... is there any way to do that...
|
|
|
|
|
A Global Message Hook will get you all the Windows Messages in the process. How you filter them is up to you. The last time I did this I was adding my own Dll to the Microsoft Management Console and intercepting the Windows messages it uses internally to redraw its controls. It was 5 years ago and I don't have the code I'm afraid.
Any other kind of messaging is going to be much more tricky and require some other techniques. I'm not sure what you're trying to achieve?
With Dll injection you can, in theory at least, intercept WinSock messaging and create a COM interception framework.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
I have an application which displays its child windows one after other at random(i mean it does not have a specific time interval for that). The contro l doesnot return untill it finishes displayin all the windows... I want to capture the screen shots of the windows.. for that i have created a new thread to write the capture code... for now what im doin is for every 2 sec i get the foreground window and capturing it.
It has foll disadvantages:
1. The time i.e 2 sec which im waiting is not constant..so it may capture the same window or skip any window if it appers fast.
2. I cannot navigate from the window since by navigating the foreground window captures the window which i have opened...
As an alternative wht i intend to do is:
When ever the child window appears the focus is shifted from the main window to the child window. So i want to interpret all the messages of the message queue and whenever a WM_ACTIVATE message happens to be present i will read it and if it's hwnd matches with my app then i will capture it...
For this i need to read the messages of the queue and since im new to this field i donno howe to go about it.
|
|
|
|
|
Your approach sounds OK, message hooking will give you what you want. Spy++ can get you any window handles you need as a one off and remember you can also monitor the creation of the child windows to get handles and such. I'm afraid I don't have any more details, you'll need to break out the MS Samples and experiment to find out how to get what you want. Good luck.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|