|
|
Hi Shay,
1) if you meening with display area your main-window call GetWindowRect() to get the size of your main-window.
2) if your display area the screen then call GetDeviceCaps(...) with HORZRES or VERTRES to get the size in Pixel (x and y) for your screen.
Then calc the size of your 3/4 Window and set the new size for it with SetWindowPos(...).
Regards
Frank
|
|
|
|
|
Hi,
How do i retrieve data from a list box inserted by a (ActiveX control i.e., the one which is inserted by clicking "insert active x control & then List Box DTC"..It seems there is a different way to do for ActiveX controls..can any one provide me with example codes..
Thanks,
Deepak Samuel
|
|
|
|
|
Judging from the C++ generated wrapper class for this control, it probably isn't very easy to do or recommended.
Is their a particular reason you want to use this control in a C++ project.
Michael
'War is at best barbarism...Its glory is all moonshine. It is only those who have neither fired a shot nor heard the shrieks and groans of the wounded who cry aloud for blood, more vengeance, more desolation. War is hell.' - General William Sherman, 1879
|
|
|
|
|
I'm trying to define a char array;
char m_pData[256][4];
I don't get any error messages, but the program stops and gives me
a unhandled exeption when i run it.
this doens't work eiterh:
char *m_pData[256][4];
or
char m_pData[10][2];
but if I write char m_pData[2][2];
this works, it's probably just some properties needed to be change?
can anyone find a solution to this?
thanx
|
|
|
|
|
lol, a similar problem was posted here some days ago...
define char m_pData[256][4]; GLOBAL!
this should solve the problem
Don't try it, just do it!
|
|
|
|
|
I think the only reason why that solved your problem is that if you step past the end of a global variable you are probably not going to interfere with the runtime stack. Your problem probably still exists but in a sneaky way. Try the following declare your values array as
double ValuesArray[190];
Guess what it probably will not crash your dialog this time either. Why does it not crash the dialog? It is overwriting other variables in your global data that could come back and cause your program to work in an unexpected way.
John
|
|
|
|
|
I just tested my theory and it worked. I created a dialog application and in my OnOk() function I did the following which caused a crash because I am stepping past the end of ValuesArray.
void CStackOverflowDlg::OnOK()
{
double ValuesArray[200];
for(int i=0;i < 300;i++) {
ValuesArray[i] = 100.0;
}
}
Guess what moving ValuesArray to the global namespace and there was no crash at all.
double ValuesArray[200];
void CStackOverflowDlg::OnOK()
{
for(int i=0;i < 300;i++) {
ValuesArray[i] = 100.0;
}
}
But have I fixed the problem? Absolutely NO! I still am using more items ValuesArray than I declared...
John
|
|
|
|
|
The array is define global and public in the header file.
I have not yet been able to use the array, because when I
define it the application stops before I'm able to do anything.
a bit of the source code:
#pragma once<br />
<br />
#include "afxwin.h"<br />
<br />
#define MAX_DATARULES 256<br />
<br />
<br />
class CSpeechControlDlg : public CDialog<br />
{<br />
public:<br />
CSpeechControlDlg(CWnd* pParent = NULL); <br />
HWND m_hwndForeground;<br />
HWND m_oldfocus;<br />
<br />
char *m_pData[MAX_DATARULES][4]; <br />
<br />
....<br />
I need to use an array to fill it with information about speech commands
which the application recognizes.
It compiles, and links, but stops with an access violation exception!
When I created a new project this initialization worked perfectly,
this makes me very confused!
|
|
|
|
|
First, with this declatration: char *m_pData[MAX_DATARULES][4]; you just declare a two dimensional array that will contains .... POINTERS TO CHAR !!! I think you have to remove the * !!
Second, if you never use the array, the problem is not because of your array ! Are you sure you never try to write or try to read in it ??? If you try to access one 'cell', be carefull: in your case it's not a char but a pointer. And this pointer is NOT INITIALIZED so, it contins an invalid adress. That's probably why you have an error !
|
|
|
|
|
cedric moonen wrote:
I think you have to remove the * !!
I'm sure that you should remove the '*'
Besides that, you are not declaring a 2 dimensional array, but an array with 3 dimensions!!! If you want to use pointers, you have to initialize the array!
this should work:
char m_pData[MAX_DATARULES][4];
the pointer version
char *m_pData[4];
and initialize it this way:
for(int i = 0; i < MAX_DATARULES;i++) m_pData[i] = (char**) malloc(sizeof(char*));
:-OI haven't been doing such things lately so the initialisation could contain some errors
good luck!
A student knows little about a lot.
A professor knows a lot about little.
I know everything about nothing.
|
|
|
|
|
Ok. For each data rule what are you storing?? Your code is written so that for each data rule you are storing a 4 pointers to characters. Here is what I mean:
#define DATA_SIZE 100
m_pData[RULE_0][0] = new char(DATA_SIZE);
m_pData[RULE_0][1] = new char(DATA_SIZE);
m_pData[RULE_0][2] = new char(DATA_SIZE);
m_pData[RULE_0][3] = new char(DATA_SIZE);
strcpy(m_pData[RULE_0][0],"This is a test");
strcpy(m_pData[RULE_0][1],"This is a test");
strcpy(m_pData[RULE_0][2],"This is a test");
strcpy(m_pData[RULE_0][3],"This is a test");
I bet this is not what you want...
John
|
|
|
|
|
I thought you were the one who had the original array question... It was spaced_out. In either case I beleive the problem was not solved and just hidden.
John
|
|
|
|
|
Can you post the code so we can take a look of what you're doing?
The problem can be if you use character strings, don't forget that there is a null character that is appended (so your string has to be 1 char larger than what it contains).
What do you what to do with char m_pData[256][4] ? Do you know that it means you have 256 strings of 3 characters (because of the null char) and NOT 4 strings of 256 char ?
|
|
|
|
|
You need to tell us more information about your problem? What size of aray do you need? Why do you need it to be 2 dimensional?
John
|
|
|
|
|
Hello ,
i don't use C++ but the GDI+ 1.1
extension in VB6 and i missing
the new const EncoderSaveAsCMYK !!!!
I don't know the value , ir must be a GUID String ,
can some tell me the value or mail it to me ?
I think it is in this file GdiPlusImaging.h
but you need a new version of it .
Did some know a MS download url how found this files
for the GDI+ ?
Thanks!!!!
Markus Rauch
|
|
|
|
|
From PlatformSDK\Include\GDIPlusImaging.h
<br />
enum ImageFlags<br />
{<br />
ImageFlagsNone = 0,<br />
<br />
<br />
ImageFlagsScalable = 0x0001,<br />
ImageFlagsHasAlpha = 0x0002,<br />
ImageFlagsHasTranslucent = 0x0004,<br />
ImageFlagsPartiallyScalable = 0x0008,<br />
<br />
<br />
ImageFlagsColorSpaceRGB = 0x0010,<br />
ImageFlagsColorSpaceCMYK = 0x0020,<br />
ImageFlagsColorSpaceGRAY = 0x0040,<br />
ImageFlagsColorSpaceYCBCR = 0x0080,<br />
ImageFlagsColorSpaceYCCK = 0x0100,<br />
<br />
<br />
ImageFlagsHasRealDPI = 0x1000,<br />
ImageFlagsHasRealPixelSize = 0x2000,<br />
<br />
<br />
ImageFlagsReadOnly = 0x00010000,<br />
ImageFlagsCaching = 0x00020000<br />
};<br />
From PlatformSDK\Include\GDIPlusEnums.h
//---------------------------------------------------------------------------
// Image encoder value types
//---------------------------------------------------------------------------
enum EncoderValue
{
EncoderValueColorTypeCMYK,
EncoderValueColorTypeYCCK,
EncoderValueCompressionLZW,
EncoderValueCompressionCCITT3,
EncoderValueCompressionCCITT4,
EncoderValueCompressionRle,
EncoderValueCompressionNone,
EncoderValueScanMethodInterlaced,
EncoderValueScanMethodNonInterlaced,
EncoderValueVersionGif87,
EncoderValueVersionGif89,
EncoderValueRenderProgressive,
EncoderValueRenderNonProgressive,
EncoderValueTransformRotate90,
EncoderValueTransformRotate180,
EncoderValueTransformRotate270,
EncoderValueTransformFlipHorizontal,
EncoderValueTransformFlipVertical,
EncoderValueMultiFrame,
EncoderValueLastFrame,
EncoderValueFlush,
EncoderValueFrameDimensionTime,
EncoderValueFrameDimensionResolution,
EncoderValueFrameDimensionPage
};
(EncoderValueColorTypeCMYK is value zero)
|
|
|
|
|
Hello ,
but i missing EncoderSaveAsCMYK (not EncoderValueColorTypeCMYK) it is a GUID
as String it looks like this {ef636393-f343-11d0-9477-00c04fd36226}
in the C++ Header it is in Bytes like ef,63,63,93,f3,43,11,d0,94,77,00,c0,4f,d3,62,26
In GDI+ Version 1.0 it is not implemented but it must be in 1.1 .
thank you to help me
Markus Rauch
|
|
|
|
|
hi
i have written a macro, which will comment/uncomment all the occurences of a particular function call like all printfs in the opened file
i want to do the same operation for all project files,
can any one help me,
Regards
Sunil
|
|
|
|
|
The first window will receives:
1) WM_KILLFOCUS with wParam set to the window you clicked.
2) WM_ACTIVATE with wParam=WA_INACTIVE.
3) WM_ACTIVATEAPP with wParam=FALSE.
You can use the Spy++ tool to see all this.
- Fistboy
|
|
|
|
|
a better english would be really nice, thx
Don't try it, just do it!
|
|
|
|
|
How can I handle hardware intrrupt message or override (Interrupt Service Routin)ISR?
|
|
|
|
|
i wrote a proggy for that, maybe i will post it on codeproject in some days... i'm still working on it, so be patient!
what os do u need a hook for, and what is the aim of this hook?
Don't try it, just do it!
|
|
|
|
|
I have an simple PCI device.
I want to read its data without pooling.
My OS is first Win98 (then Win XP).
Please do it;) as soon as
|
|
|
|
|
This will not be easy. You need to download the DDK (device driver kit) for windows 98 and XP. In windows 98 you may be able to not use a device driver and can write a standard DOS ISR but with interrupt sharing (many devices can share the same hardware interrupt) you may run into problems. So you would have to write a VXD (device driver) for Win98 and a SYS for XP. There should be some documentation how to do this in the DDK for each of these.
John
|
|
|
|