|
It's a 1 * n matrix (i.e. a column of number, size n) of varying precision generated by an external program to my MFC project. I guess I could find the size of the array by counting the elements.
kash
|
|
|
|
|
if you have access to the output algorithm, that would certainly help. I know it would be a nightmare if I gave someone one of my binary files and said "here, read this", without knowing how I built it.
I guess the key question is if they are serializing the object as a whole, or simply exporting the data within the array. If it is the latter, you could use a std::vector and just pump the values back in.
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
I'm trying to allocate an array of list iterators based on the size of the list so I can later delete them. But the compiler won't let me create an array without a constant expression.
list<Vertex>::iterator itr1 = vertexList2D.begin();<br />
list<Vertex>::iterator itr2 = vertexList2D.begin();<br />
list<Vertex>::iterator erase[vertexList2D.size()];
while (i < size);<br />
for (i = 0; i < count; i++)<br />
vertexList2D.erase(erase[i]);<br />
}
How should I go about doing this?
|
|
|
|
|
create a vector of list::iterator items.
vector< list < Vertex >::iterator > iterVector;
-c
When history comes, it always takes you by surprise.
|
|
|
|
|
Hello, I'm developing an interface in visual C++ 6.0...I have some boxes to input data. The program should be able to identify what data was inputted..that is I have three boxes and I just want to change the contents of the third one, if I type twice the tab-key, the contents will be no changed, but if I type something, how can the program know that the contect is being changed, or the contents remaind the same?.
I have tried with the OnkillfocusFUNCTION so to detect that i'm moving from one to another. inside the the function I'm using UpdateData() to retreive the data, but how can i implement the identification of the contents-update without having to ask for a previous value. in code this seems like:
if (field_code != old_value)
//do something
else
//continue
Is there anyother eaier way to do this?
Thanks,
Eric Manuel Rosales Pena Alfaro
PhD student
Unversity of Essex
Wivenhoe Park
Colchester, CO4 3SQ
Essex, Uk
email: emrosa@essex.ac.uk
tel: +44-01206-87311
|
|
|
|
|
The way I'd do this is to use EM_GETMODIFY/EM_SETMODIFY.
If you're using MFC, the easiest way may be to modify the DoDataExchange function so that after setting the text for the edit controls (if they're bound to member variables) you then use EM_SETMODIFY to say the controls aren't modified.
In the case where you're reading them, then use EM_GETMODIFY to find out if the user made a change. This means you don't have to cache the values.
Steve S
[This signature space available for rent]
|
|
|
|
|
Simply use EN_CHANGE event of Edit control
|
|
|
|
|
I want to draw a line inside my view window.When i will left click in the view window the line should expand according to my mouse move and when i will right click the line should be drawn from the left click point to the right click point(before that no line should be drawn)
how can i do that ?
manoj Kumar Dalei,
IIT Delhi
|
|
|
|
|
Handle the WM_LBUTTONDOWN and WM_RBUTTONDOWN messages, saving the points at which these occur, then in your WM_PAINT handler (or OnDraw if MFC) just use GDI calls (or CDC members) to do the line drawing. Check out the SCRIBBLE tutorial if you're using MFC.
Steve S
[This signature space available for rent]
|
|
|
|
|
Hiya how do you completely REMOVE a function or variable in .NET from the project...
grahamoj
|
|
|
|
|
.net has no class wizard like 6.0, if you wanna remove a function or variable you will need to remove it from the .h file of the class, and from the .cpp in case of a function
still a newb.. cut me some slack :P
-dz
|
|
|
|
|
I usually use delete button, but you probably could also use backspace as well.
|
|
|
|
|
Anybody know how to set the width of a console window's app in VC++ 6? Like, say from 80 characters or whatever the defualt is to 120?
Thanks
|
|
|
|
|
I think it could be done with SetConsoleScreenBufferSize and SetConsoleWindowInfo.
Chris Richardson
C/C++ Include Finder[^]
|
|
|
|
|
I know how to build a project in VC6.0 but in VC7.0 the buttons for build are grayed out I am assuming it is because I have not complie the source file but in 7.0 I have not found the menu choose or button to do this Please help
|
|
|
|
|
all you should have to do is have a solution/project open and go to the 'build' drop down menu then 'Build Solution'.
still a newb.. cut me some slack :P
-dz
|
|
|
|
|
|
According to MSDN, if source and target memory blocks overlap, using CopyMemory "the results are undefined". For overlapped blocks, we should use the MoveMemory function instead.
Having that been stated, my question is: why should we use CopyMemory? Is it OK to ALWAYS use MoveMemory even if the blocks do not overlap? Also, what does the verb "Move" imply here? Since the argument of source block is a "const VOID*", which means referenced memory data are unalterable...
Anyway, whats the deffernce between "CopyMemory" and "MoveMemory" other than one cannot copy overlapped blocks and the other can? Thanks a lot.
|
|
|
|
|
=[ Abin ]= wrote:
why should we use CopyMemory?
It may be faster than MoveMemory.
=[ Abin ]= wrote:
Is it OK to ALWAYS use MoveMemory even if the blocks do not overlap?
Absolutelly.
=[ Abin ]= wrote:
what does the verb "Move" imply here?
Nothing. Assembly copy instructions also called move.
|
|
|
|
|
That made things clear, thank you.
|
|
|
|
|
I am sending in an STL vector "keys" via my Create() :
Which should I do? In this case keys doesnt get changed in the class.....
Create( UINT iD, CWnd* pWnd, std::vector(CString) keys)
Or
Create( UINT iD, CWnd* pWnd, std::vector (CString)& keys)
Then I would just copy the incoming vec into a member in the Create function:
m_myKeys = keys;
==========
SO which prototype do I want?
How to get angled brackets to show up in the forum?
Appreciate your help,
ns
|
|
|
|
|
Probably
Create(UINT iD, CWnd*pWnd, const std::vector& keys)
The reason for a reference rather than not is that it prevents the creation of a temporary copy of the object in question, which might be quite expensive. The reason for const is that you're not changing it, so why not say that!
Steve S
[This signature space available for rent]
|
|
|
|
|
Okay so if I wanted to vchange "keys" I skip the const. Thats fine. My last confusion right now is this. I cant use the incoming vector in Create(), but i want to change it. SO I assign it to a member m_myClasVec, but when I make changes to m_myClasVEc they wont get transmitted through to "keys" . Whats the solution to this? It needs to be in a member vector because I want to do stuff to it outside of create....
Appreciate your help,
ns
|
|
|
|
|
In that case, you need to use pointers;
You can't use a reference as a member because you can't assign it after the constructor, so your member will have to be a pointer, and your parameter in Create will too.
Then, of course, you'll have to change all those
m_myClasVEc. into m_myClasVEc-> to make it all work again.
Steve S
[This signature space available for rent]
|
|
|
|
|
Ah....these things are so tricky..........I keep thinking I have these notions of references and pointers under control....I did see that it didnt want an unitialized reference as a member, but couldnt think of how to sidestep it...MAny thanks
Appreciate your help,
ns
|
|
|
|