| Hi All, While running a C++ Service in Wice indows 2008 Server i got below dump for service crash. Crash Dump ------------ 00 ntdll!ZwWaitForMultipleObjects+0xa 01 ntdll!RtlReportException+0x55e 02 ntdll!RtlReportException+0xbc 03 ntdll!RtlpNtMakeTemporaryKey+0x216 04 ntdll!_C_specific_handler+0x96 05 ntdll!wcstok_s+0x34be 06 ntdll!_chkstk+0x9d 07 ntdll!RtlRaiseException+0xf67 08 ntdll!RtlRaiseException+0x18d 09 ntdll!RtlpNtMakeTemporaryKey+0x1c0 0a ntdll!RtlpNtMakeTemporaryKey+0x3402 0b ntdll!RtlpNtMakeTemporaryKey+0x4000 0c ntdll!memset+0x160da 0d msvcr110!gratuitous+0x1c 0e wincli32!ConnectDlg+0x392 0f wincli32!OsGetCOPCLIVersion+0x7fed 10 ntdll!RtlActivateActivationContextUnsafeFast+0x114 11 ntdll!LdrShutdownThread+0x116 12 ntdll!RtlExitUserThread+0x3e 13 kernel32!BaseThreadInitThunk+0x15 14 ntdll!RtlUserThreadStart+0x34 please help me out. Cheers, Uday | | | janaswamy uday wrote: delight assist me out. With what? No ane here has the remotest idea what plan(due south) you are running or where this error may have occurred. | | | | Here's a quick run-downward of the NEC protocol. http://techdocs.altium.com/display/FPGA/NEC+Infrared+Manual+Protocol[^] And here'south some more than full general stuff: https://en.wikipedia.org/wiki/Consumer_IR[^] A good identify to look for the actual data/commands sent using the various protocols is in the microcontroller community. The Arduino/8501 forums/libraries have plenty of code available. I once setup an arduino to record the incoming pulses from a remote. I then swapped the IR receiver module for a cheap 1mw laser - I tin can control the IR equipment from over 100m abroad at present. Unfortunately, the code'due south on a auto I dont have access to now and I've long since forgotten where I got the info from, lamentable. "When I was 5 years old, my mother always told me that happiness was the key to life. When I went to school, they asked me what I wanted to be when I grew upward. I wrote downwards 'happy'. They told me I didn't understand the assignment, and I told them they didn't empathise life." - John Lennon | | | Thank. | | | ........ | | | Hi there. I have this construction in Header1.h and instantiating this structure in Header2.h. When I try to initialize this instance, I get this runtime exception. Here is my skeleton of code HEADER1.h struct Pupil { CString Name; CString Address; CString Telephone; }; HEADER2.h class CHeader2Dlg { Student educatee; } HEADER2.cpp void CHeader2Dlg::SomeFunction() { student.Name = " "; pupil.Address = " "; student.Telephone = " "; } | | | Are you lot possibly using the Unicode grapheme prepare but assigning an ascii string? Perchance it should be: pupil.Name = L" "; The difficult nosotros do right away... ...the impossible takes slightly longer. | | | I inverse that to L"" only in vein. Does it have to do annihilation with project settings ? | | | I suspect there is something more than going on than merely the code you have posted. It sounds as if the CString object is not being instantiated. Perchance if you could post more, relevant lawmaking. The difficult nosotros practice right away... ...the impossible takes slightly longer. | | | Header1.h struct Account { CString Name; CString Address; CString Phone; }; Header2.h class AccountDlg : public CDialog { Business relationship account; } Header2.cpp void AccountDlg::Load(int id) { CEdit* edit; CComboBox *combobox; account.Proper noun= " asd"; account.Address= " asd"; business relationship.Phone = " asd"; accountId = id; accountSettings.AccountLoad(accountId,account); } | | | That doesn't reveal anything more than the first post. I think you should mail the bodily lawmaking, non an obfuscated version of it. Testify the "#includes" too. The difficult we exercise correct away... ...the impossible takes slightly longer. | | | Take y'all tried explicitly calling the struct'due south constructors in the grade constructor? class AccountDlg: public CDialog { Business relationship business relationship; public: AccountDlg() : account() {} } | | | Django_Untaken wrote: Here I am getting the said exception What exception? | | | Admission violation reading location. Merely earlier this exception, if I debug the application, I encounter that member variables of this object dont evidence and Error reading characters of cord shows up instead, in the intellisense. | | | That suggests that you have non initialised the object. Have you checked that the constructor is called and sets all the variables correctly? | | | Information technology does not look like yous are reading the cord, y'all are actually assigning values. It seems the exception is from somewhere else.. Is this the complete lawmaking you are debugging ?? Could yous delight share the total code if possible ? | | | I am still struggling with pointers arithmetic. Hither is my crude exam code. I want to use pointers to access ( double - demand triple somewhen) the array of characters and do not get two things. Problem #1 is probably how does the LCD course do the "print" and I can figure that one by myself. I exercise non expect this forum to exist familiar with Arduino "library". Problem # 2 I can print single characters in simple assortment past incrementing the pointer, but I cannot figure out why I cannot utilise same method on double assortment. I actually do not understand what is this error telling me "error lvalue required as increment operand" - what is "lvalue" ? Delight keep in mind that English language is not my native language so go like shooting fish in a barrel on " pointers to array..." "array of pointers" etc. Equally always , I appreciate your help. Cheers Vaclav Addendum OK, I did some more reading nearly how the array is initialized and how the NAME of the array cannot be used the way I did try it. And then I did this - information technology "works" , merely I am still not sure if it is correct or merely a fluke. char *arrow = stringTable[0]; lcd_i2c.print((char*) pointer++); // prints entire line lcd_i2c.impress((char*) pointer); // prints entire line starting with 2d character - expected that Original postal service code starts here char line[MAX_LINE] = "A TEST B"; int ncharacters = strlen(line); char *sptr; // pointer to retention cake returned by malloc char *stringTable[NLINES]; // assortment of pointers to string int i = 0; sptr = (char*) malloc((unsigned) strlen(line) + i); lcd_i2c.clear(); lcd_i2c.print("Alphabetize "); lcd_i2c.impress(i); lcd_i2c.setCursor(0, one); lcd_i2c.print("Length "); lcd_i2c.print(ncharacters ); lcd_i2c.setCursor(0, 2); lcd_i2c.print("arrow "); lcd_i2c.print(sptr); // problem #one prints the unabridged line - non really a trouble here strcpy(sptr, line); // copy line to pointed memory lcd_i2c.print(sptr); // TOK prints pointer value ? // re-create pointer to starting time table array stringTable[0] = sptr; lcd_i2c.setCursor(0, iii); i = 0; do { // TOK prints showtime character from stringTable[0] lcd_i2c.print((char) * (*stringTable)); // trouble #ane prints only the first grapheme - why information technology would exist nice to print the entire line using pointers! } while (*(*++stringTable)); fault lvalue required as increment operand -- modified 26-Jul-15 eleven:18am. | | | Information technology'south really rather hard to effigy out what y'all are trying to do since some of the to a higher place code makes no real sense. Yous are using casts on pointers that are already pointers, so do nada except add confusion. You lot classify a block of memory then try to impress information technology before information technology contains anything. You create an array of ponters for no apparent reason and so use only the first 1, you copy data from one memory cake to another, again for no real reason, etc. Maybe you should show exactly what trouble y'all are trying to solve, without all this code and we can suggest on the best option. And an caption of what the impress function actually does, or is supposed to do. Also delight apply <pre> and </pre> tags effectually your code so it is more readable, like this: lcd_i2c.clear(); lcd_i2c.print(" Alphabetize "); lcd_i2c.print(i); lcd_i2c.setCursor(0, 1); | | | Well, you tin can easily expect at the information-sheet for the I2C scrap on the LCD lath and at the ane for the 1602/1604/2002/2004 LCD you're using. In one case done, you can see that the LCD has a hardware cursor, and knows at which position on the display it is. It also has a means to write a character to the current cursor position. Here'due south a quick list of the bachelor commands: http://world wide web.8051projects.net/lcd-interfacing/commands.php[^] Not covered in that particular document, is the fact that y'all define custom bitmaps for characters - up to four or so at whatever once. Y'all could for instance, brand a bitmap of a battery and so animate a charging display by changing the bitmap used for the battery 'grapheme'.(but not actually irresolute the character drawn - information technology's the bitmap that this character refers to that is changed) Here's a tool I whipped-up a couple of years back that makes cartoon such custom characters piece of cake. I've used this for both ascii/graphical LCDs - I don't remember if the output was suitable for both or simply one or the other. Lcd Character designer The 'save' push causes the changes made to a character in the top-pane to be written to the 'memory' of the LCD panel and causes the appearance of the currently chosen character to change. As for the arrow stuff, you seem to be making it considerably more complex than it needs to exist. Here's a quick sample. I dont accept admission to an arduino this moment, so have used printf instead. int main() { char *stringTable[] = { " string 1", " string 2", " string three", NULL }; int i, north = sizeof(stringTable) / sizeof(*stringTable); for (i=0; i<n-1; i++) printf(" (%d chars): %s\n", strlen(stringTable[i]), stringTable[i]); printf(" -------------\northward"); char **curPtr = stringTable; do { printf(" %due south\northward", *curPtr); curPtr++; } while ( *curPtr ); } "When I was 5 years old, my mother always told me that happiness was the central to life. When I went to school, they asked me what I wanted to be when I grew upwards. I wrote down 'happy'. They told me I didn't understand the assignment, and I told them they didn't empathize life." - John Lennon | | | Thanks, basically you confirmed that I need a arrow to the double dimension array. That is all I wanted to know. Cheers Vaclav | | | Why are you using both a sentinel value and the array size (just out of curiosity)? | | | Simply to show ii ways of doing the same thing. Vaclav's code expects a sentinel, while I adopt to piece of work without one. "When I was 5 years old, my mother always told me that happiness was the primal to life. When I went to school, they asked me what I wanted to be when I grew up. I wrote down 'happy'. They told me I didn't understand the consignment, and I told them they didn't sympathise life." - John Lennon | | | Ok I think I am getting the picture. But I cannot effigy out how to implement same pointer arithmetic in double assortment. I got the start "record" working fine, can access all strings / fields, but cannot go to the next one. I am all the same not certain how does the pointer , and not the char in array , get incremented. I have deleted the LCD code which confused many and added printf , which is not part of "core" Arduino code , and so this should pass by them now. I even so would like some verbal description of the assignment of pointer to the assortment. Appreciate your help very much. Cheers Vaclav <pre lang="c++"> // double array of pointers char *stringTable[][v] = {{ "string 1", "string two", "string three", Zip }, { "2nd cord 1", "2d string two", "second string three", Nada } }; char **curPtr = *stringTable; // pointer to array of pointers do { printf("%due south\n", *curPtr++); // dereference to get the ptr to the cord } while ( *curPtr ); // quit loop when we become to our Naught pointer.<pre lang="c++"><pre lang="c++"></pre></pre></pre> | | | No trouble, it'south ane of the bug that seems to beat-up people regularly. I more or less started with ASM, so it was a matter of sink or swim in brusque order. How nigh this, does it assistance? int principal() { char *stringTable[][iv] = { { " cord 1", " cord 2", " string three", Nothing }, { " second string 1", " second string two", " second string iii", Zero } }; int y; for (y=0; y< sizeof(stringTable)/sizeof(stringTable[0]); y++) { char **curPtr = stringTable[y]; practise { printf(" %south\n", *curPtr++); } while (*curPtr); printf(" ----\north"); } } "When I was five years old, my mother always told me that happiness was the central to life. When I went to school, they asked me what I wanted to be when I grew up. I wrote downwards 'happy'. They told me I didn't sympathize the assignment, and I told them they didn't understand life." - John Lennon | | |