112 Posted Topics

Member Avatar for nexocentric

Are you confident that PositionToSave[1] is being set to a value which is within the bounds of the SAFEARRAY 2nd dimension? Have you checked with the debugger/cout statements. You say you're using a 2 dimensional array created in VB6. Was it created using SafeArrayCreate()?

Member Avatar for nexocentric
0
418
Member Avatar for johnray31

I'm not entirely sure whether you want to get a time and store it in a uint32 for later retrieval, or get the real time at any moment from a uint32. If its the former, it's possible, for simple hours,minutes,seconds over a 24 hour range you could use a union …

Member Avatar for johnray31
0
181
Member Avatar for abhi_elementx

It's only executed once, so that class would work as a singleton. An alternative technique which avoids the need to clean up the memory allocation is: [code=cpp] Singleton& Singleton :: getInstance() { static Singleton obj; return obj; } [/code] Pros and cons to each method.

Member Avatar for MrSpigot
0
103
Member Avatar for Fouly

You haven't shown the signature for OnRecoEvent(), but it should be like this:- Declare the function in CSpeechDlg as: afx_msg LRESULT OnRecoEvent(WPARAM wp, LPARAM lp); and define it as: LRESULT CSpeechDlg::OnRecoEvent(WPARAM wp, LPARAM lp) { [INDENT]return 0; // or 1[/INDENT] }

Member Avatar for Fouly
0
359
Member Avatar for Duki

[QUOTE=Agni;849956]If you are passing the address of result then it's definitely a problem because you have not allocated 'result' on the heap. It's a local variable in the function Union and it disappears when we exit the function, if you try to access that address you can get run-time errors.[/QUOTE] …

Member Avatar for Duki
0
300
Member Avatar for Sky Diploma

It's not very intuitive (to me anyway), but a reference to an array is declared: int array[10]; int (&ref)[10] = array;

Member Avatar for MrSpigot
0
260
Member Avatar for fearsneachta

Don't forget your semi-colons: float fltBonus[B];[/B] float fltMoney[B];[/B] system ("PAUSE")[B];[/B] fltBonus = 0.02 * fltMoney[B];[/B] And case statements look like this: case 50.0:

Member Avatar for fearsneachta
0
113
Member Avatar for KarthikOnIT

Wizard mode doesn't work quite like that. When you set wizard mode the sheet moves through all its pages using next/prev instead of tabs. So all your pages on the sheet are expected to be part of one wizard. If you want a wizard with 2 pages, and two other …

Member Avatar for MrSpigot
0
98
Member Avatar for jimjimjimz

Is your AdventureGame class using static variables? If so the new instance could be using some state information from the previous run. Check that these variables are properly initialised in the constructor, or convert them to non-static members if possible. The easiest way to get to the bottom of it …

Member Avatar for jimjimjimz
0
136
Member Avatar for BruenorBH

I would start by changing your radio resource styles from BS_RADIOBUTTON to BS_AUTORADIOBUTTON. The BS_RADIOBUTTON style requires you to do more of the work yourself.

Member Avatar for BruenorBH
0
315
Member Avatar for f.ben.isaac

You should be pleased with your first attempt, it demonstrates threading nicely. There are some criticisms I would make: Your mutex isn't actually achieving much - totalNumber is only being updated by one thread. main() is just reading it, so no protection is necessary in this case. If you are …

Member Avatar for Clockowl
0
151
Member Avatar for abhi.nalluri

Items in a list box are not generally displayed in a fixed width font. So the length of the string will vary with different numbers, even though the number of characters is constant. You could modify the list box to use a fixed font, though you might not find that …

Member Avatar for MrSpigot
0
102
Member Avatar for viji.sarathy

[QUOTE=viji.sarathy;846521]How can i use the defined functions into the forms?[/QUOTE] Yes, the subject said that. How about giving us a bit of the background. Remember, nobody here was looking over your shoulder while you've been struggling with this problem. It's your first post, I'm going easy on you;)

Member Avatar for MrSpigot
0
51
Member Avatar for Akis2000

[QUOTE=Akis2000;845557]thank you for your help.... also you don't anwser to my main question.... my idea for this fuction , I mean my logic for this fuction is corect?? it give me the right output?? i try i and i think it's corect so...... I'm waitting for answer from one more …

Member Avatar for Akis2000
0
112
Member Avatar for tag234

I don't see a problem with the code you posted. I even tried running the following:- [code=cpp] void getData(double **x, double **y, int n) { *x = new double[n]; *y = new double[n]; *x[0] = 2.6; } [/code] And the call:- double *xarr = NULL; double *yarr = NULL; getData(&xarr, …

Member Avatar for siddhant3s
0
84
Member Avatar for mj85

Declare maqr() like this: [code=c] int maqr(double* a[], int m, int n, double* q[]) { // and access the elements of a and q like this: double x = *a[0]; } [/code]

Member Avatar for jephthah
1
97
Member Avatar for everard

I would guess that it's complaining because Parse() is not declared static. If you can arrange for Parse() to be static, AfxBeginthread() will be a lot happier.

Member Avatar for MrSpigot
0
367
Member Avatar for acoxia

You're allowing the r value to get to 6 before you reset it. When it reaches 4 you already have problems because you access line[r+1], i.e. line[5], which doesn't exist. Try resetting when r > 3.

Member Avatar for acoxia
0
96
Member Avatar for ganmo

In the constructor you are calling p.insert() where p is an object of class Set. Presumably you want p to be an object of class Node?

Member Avatar for Lerner
0
133
Member Avatar for power_computer

Your passing by reference is fine for AverageNum(), but you do seem to be calling it before the file has been opened. Why do you have two calls to AverageNum()?

Member Avatar for power_computer
0
116
Member Avatar for 0o0

[QUOTE=0o0;839362]bump! I can't figure out how to change gui from background worker![/QUOTE] No, you won't be able to update a GUI from a worker by calling it directly. You need to use message passing. i.e. call SendMessage() or PostMessage() to send a user defined message to the GUI thread. You'll …

Member Avatar for 0o0
0
207
Member Avatar for everard

Tricky without seeing the code. Is there something different about the line format after 2000 lines? Try editing out 1500 lines and see if it falls over at the same place. Are you allocating memory dynamically and not releasing it? Have you allocated a static buffer which you are overflowing?

Member Avatar for tux4life
0
100
Member Avatar for bailey537

I would define the 'parent' class before the 'people' class, and before 'people' I would add a forward declaration "class person;".

Member Avatar for Danny_501
0
60
Member Avatar for beatlea

You probably don't want to hear this. I don't know how to solve your problem and I get the feeling you're creating Frankenstein's monster. Passing around pointers which can point to different types is already giving you a headache. Your testing/debugging will be difficult and the poor swine that maintains …

Member Avatar for beatlea
0
120
Member Avatar for christiangirl

You seem to have two classes, Queue and mergeSort. mergeSort is derived from Queue. mergeSort is using a different struct for it's nodes than Queue, which isn't helping. I suggest you use struct Data for the nodes in both classes. As mergeSort is a Queue, in main() you'll be wanting …

Member Avatar for christiangirl
0
232
Member Avatar for viki0077

[QUOTE=viki0077;837761]1.1 Can a destructor, defined in a base class, be inherited by a derived class? 1.2 Can a base class destructor be overridden in a derived class? 1.3 Does an abstract class need a contsructor? [/QUOTE] You're clearly realising that the Constructors and Destructors are not your average method. Good …

Member Avatar for viki0077
0
131
Member Avatar for amegahed3

Well, if you knew the exact length of the 3 lines to be ignored, and you knew that this length would never change, you could use a file seek command to take you straight to the point in the file that you are interested in. However, that's making assumptions about …

Member Avatar for jephthah
0
271
Member Avatar for Drifter666

Your CharNode contains member "char data;" and you're trying to assign a string "First" to that char. That isn't going to work because "First" is actually a pointer to a null terminated array of chars and you're trying to say: char = pointer to char. If you want strings in …

Member Avatar for Drifter666
0
3K
Member Avatar for majesticmanish

That snippet cannot work because, in func the compiler is unable to handle tap->par1. The details of class B are unknown at this point. The header file will compile, but the cpp file will need another include which contains the class definition for B.

Member Avatar for majesticmanish
0
115
Member Avatar for DanielB2

Just declaring your classes before they are used isn't always sufficient. E.g you declare class MoveList; before it is used in class RandomPlayer : public BackgammonPlayer but in this case you actually need the complete class definition of MoveList before the definition of RandomPlayer. If you were using a pointer …

Member Avatar for Ancient Dragon
0
219
Member Avatar for AnGuRuSO

The vector manipulates the objects as StaffMembers, but in spite of that, they are still objects of the class you created them as, and GetType() should work fine. If GetType() always returns 's', I wonder if you've forgotten to make it public virtual in the base class?

Member Avatar for AnGuRuSO
0
884
Member Avatar for daviddoria

Just my opinion but the outline of the problem is that you have a Cluster which consists of a set of points and a centre point which you have somehow derived from that set. To me that is best modelled by a Cluster class containing a vector of points, and …

Member Avatar for daviddoria
0
118
Member Avatar for OffbeatPatriot

[QUOTE]My concern is this, what is the life span of a state returned by new_state?[/QUOTE] I'm a little confused by that but I assume you meant next_state and not "new state". I don't see you allocating any memory, just moving pointers around, so presumably you allocate the states dynamically somewhere …

Member Avatar for MrSpigot
0
99
Member Avatar for ssDimensionss

By performing this calculation: 1836131903 + 1134903170 = 2971035037, you've set the top bit of a 32 bit register. That's still within the 32 bit range of the register but the "bgtz $t0, done" instruction is checking whether the register is greater than zero. The top bit is the sign …

Member Avatar for MrSpigot
0
104
Member Avatar for kunal123

[QUOTE=kunal123;833892]hii, i cannot connect to the ms sql server.... i am using CDatabase class for connection the error message i am getting is what i hv posted above.. pls help me with the error message, even if i try to ping the server ip address it says timeout and fails.. …

Member Avatar for MrSpigot
0
164
Member Avatar for tomtetlaw

A semi-colon wouldn't go amiss at the end of this definition in maindef.h : template<typename t> class list {...}[COLOR="Red"][B];[/B][/COLOR]

Member Avatar for tomtetlaw
0
155
Member Avatar for Falkoner1

Surely you don't need to call: delete this; at the end of the destructor. You are in the destructor because delete has already been called. Calling it again creates the recursion.

Member Avatar for Falkoner1
0
171
Member Avatar for Nemoticchigga

Yes, you are getting an array of pointers. Instead, declare your array of structs: foo test[10]; Now you have 10 foo objects and foo[0].myMember will reference the contents of the first one. To get a pointer you then use: foo* pFoo = &test[0]; which will give you a pointer to …

Member Avatar for MrSpigot
0
116
Member Avatar for konczuras

Convert your integer to float before doing the division. e.g. int nIn = 50; float fOut; fOut = ((float)nIn)/100;

Member Avatar for konczuras
0
140
Member Avatar for Talguy

If I understand you correctly, there are (at least) a couple of possibilities. You could delare a union which makes both data types available. Read your input into the char array in the order you want, then use the unsigned long for processing. [code=c++] union { unsigned long theLong; unsigned …

Member Avatar for Talguy
0
116
Member Avatar for guest7

Assuming you can get it to compile, your string comparison in: if(line1 == line2) is actually comparing the addresses of line1 and line2, not the array contents. Try using string objects to store the lines, or use an array comparison method such as strcmp().

Member Avatar for MrSpigot
0
95
Member Avatar for power_computer

If you just want to get numbers sorted a convenient solution is to use the STL sort() function. Look it up here [URL="http://www.fredosaurus.com/notes-cpp/algorithms/sorting/stl-sort-arrays.html"]STL Sort[/URL] However if you want to implement your own algorithm, well, there are several algorithms with pros and cons which would depend on your requirements. The [URL="http://www.cplusplus.happycodings.com/Data_Structures/code11.html"]quick …

Member Avatar for GDICommander
0
98
Member Avatar for bluebird

I don't see any obvious problem. Would you like to tell us what output you are getting and why you don't like it?

Member Avatar for tux4life
0
110
Member Avatar for bluebird

If it's just the unary + operator you're worried about I'd say it doesn't have to do anything, so unless you want some non-standard functionality: void operator+(){} should be a good partner to your operator-. ...and just stop lying.

Member Avatar for MrSpigot
0
88
Member Avatar for neox183

Firstly the reference variables thing. In the context of parameter passing to functions, using a reference variable has the effect that any change to the variable inside the function will also change the variable in the caller. So, in this simple example, x is passed by reference and is altered …

Member Avatar for neox183
0
92
Member Avatar for Moe

Your operator+ method is not actually a member of Distance. You need to define it as Distance Distance::operator+(Distance d)

Member Avatar for Moe
0
115
Member Avatar for blackbyron

First the moan - as this is your 9th post you should know about code tags. Please use them, you'll get more help. Now some problems: GasPump::salePriceHigh() is being called with an uninitialised variable (gal2). GasPump::display() is only outputting the value for totalHigh so obviously won't be correct for low …

Member Avatar for blackbyron
0
106
Member Avatar for r0flc0pter

It would help to see the code which is calling these methods. Are you trying to call get_name() from a constant CControl object?

Member Avatar for ArkM
0
155
Member Avatar for fx7202

In your simDiceThrow() loop you output the dice values, but then calculate the number of even values by throwing the dice again. So the number of even values has no relation to the numbers previously output. The logic you actually need is to throw the dice n times, remembering each …

Member Avatar for fx7202
0
119
Member Avatar for delifion

The End.