|
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
|
|
|
|
|
LOOL, looks like u don't really know very much about that John!
ok Behzad, first you have to get the device driver kit from microsoft, it's free, only shipping has to be paid! (ddk is not free for download, u'll have to order it!)
-> you can find the online documentation of the ddk at http://msdn.microsoft.com[^] in section "Windows Development\Driver Development Kit".
-> ddk order here: http://www.microsoft.com/whdc/ddk/winddk.mspx[^]
i can only tell you, how this works on windows nt based systems, i dont like win98, so i dont code drivers 4 it
to connect to these interrupt events, use the IoConnectInterrupt API!
you will find more detailed infos here:
http://www.winnetmag.com/Articles/Index.cfm?ArticleID=298&[^]
http://www.microsoft.com/mspress/books/sampchap/2507b.asp[^]
with source code:
http://www.beyondlogic.org/interrupts/winnt_isr_dpc.htm[^]
@john: coding device drivers is NOT DIFFICULT!
Don't try it, just do it!
|
|
|
|
|
Alexander M. wrote:
looks like u don't really know very much about that John!
No its not my are of interest, however I have created device drivers.
Alexander M. wrote:
first you have to get the device driver kit from microsoft, it's free, only shipping has to be paid! (ddk is not free for download, u'll have to order it!)
I downloaded all of the DDKs for free a few years back...
Alexander M. wrote:
@john: coding device drivers is NOT DIFFICULT!
I agree but It is not for the beginner programmer...
John
|
|
|
|
|
who called Behzad Ebrahimi a beginner?
Don't try it, just do it!
|
|
|
|
|
I get these kind of questions at least once a week and 90% of the time its way over their head. But since he did talk about an ISR he has some idea what he is talking about.
John
|
|
|
|
|
Hi, I am using a CHtmlView and I need to open a new window to the corresponding link when the new window option is chosen. I am able to make a new frame, I have put it on my CMultiDocTemplate (or something like that) and load the frame when the option is clicked. However, I don't know how to get the address of the link that was clicked on. How do I do that?
|
|
|
|
|
Hi, can ne1 help
if i had a string, mystring = "0933221212"
and i wanted to replace the first two characters "09"
with say "012" so i was left with "01233221212"
whats the best way of doing this
thanks loads
si
|
|
|
|
|
CString mystring = "0933221212";
mystring.Replace( "09", "012" );
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
thanks for the quick reply
the problem with what you sent me, is that it will replace
all occurrances of 09 with 012, i need it to replace only one
occurance of 09 which will always be the first two characters
thanks
si
|
|
|
|
|
CString mystring = "0933221212";
mystring.Replace( "09", "012" );
CString strRightPart = "012" + (mystring.Right(mystring.GetLenght()-2));
::AfxMessageBox(strRightPart);
I think it's something like this.
Best regards
Jens
|
|
|
|
|