|
right.
mIchAel Liu
__________________________________________________________
The secret of business is to know something that nobody else knows.
|
|
|
|
|
I've installed the latest MS Plateform SDK in a different directory from the directory of VC6. How can I compile my program with the latest SDK files?
Thanks.
mIchAel Liu
|
|
|
|
|
Go to Tools->Options->Directories page, add ?:\PROGRAM FILES\MICROSOFT PLATFORM SDK\INCLUDE path to directories list and move it to the top of the list.
|
|
|
|
|
|
Hello!
I read something about CDragListBox.
How can I create it?
Can I use the same member-functions as in CListBox (like GetText(), GetCurlSel(), SetCurlSel())?
Thank you very much!
Lucky2002
|
|
|
|
|
Yes you can (CDragListBox derives from CListBox .)
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hello!
But how can I create a CDragListBox?
Thank you!
Lucky2002
|
|
|
|
|
Drag and drop a listbox control in your dialog resource editor, then launch the MFC wizard (CTRL+W) and associate a control variable of type CDragListBox to the newly created control.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hello!
I´m sorry , but when I want to associate the member variable, I can only choose the type CListBox.
What must I do, that the CDragListBox-type is possible?
Thank you!
Lucky2002
|
|
|
|
|
Well, associate it a CListBox and then manually replace the type for CDragListBox in your source code.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hello!
I change the type CListBox in CDragListBox.
Before: CListBox m_ctrlListBox;
After: CDragListBox m_ctrlListBox;
It´s changed in the class wizard too.
But when I run the programm I get a debug error. It doesn´t works.
Must I change something else?
Thank you!
Lucky2002
|
|
|
|
|
Uhmmm... Check the docs, I think there' a couple of styles that must be checked for the control in order to associate to a CDragListCtrl .
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Sorry, what are the docs ????
Lucky2002
|
|
|
|
|
Ok, so I'm developing a post-processing data reduction and visualization program. I have all my graph controls and UI together with custom vector templates for the control's data and all that fun stuff. But my weak point is file IO and storing the data read from the files. The files are csv and don't necessarilly contain doubles for data. Some may be hex denoted by "0xABCD1234", or may even be an enumeration. So streaming the file into my vector templates was shady. So I created a class that has the following member (among others):
#define MAX_VARS 200
#define MAX_SAMP 75000
CString m_DataArray[MAX_SAMP][MAX_VARS];
I then allocate a 'new' CSV class and put one of these things on the heap. The good news is that the data is global for all my numerical analysis tools and functions and I can manipulate it fast. The bad news is that I rarely have 200 vars and 75000 samps, so mass memory is very wasted! Even worse, when I'm under the gun to outperform Excel or PV-Wave, I may have up to .25 Million samples or more (Excel dies @ 65536 / PV-wave can't do more than 2048 chars per line)!! I tried ohter CSV classes to access row,col but with many samples the process is slow.
Anyway, I'm just probing for alternatives. I tried CStringArray but got lost because all my routines operate on 2d arrays (row,col). Any comments or advise is certainly appreciated in advance.
Thanks All.
Nitron
_________________________________________--
message sent on 100% recycled electrons.
|
|
|
|
|
Ok, this might be a solution. Use a std::vector<std::vector<std::string> > > ,which can easily grow on demand. To maintain the 2d array interface, wrap the thing into a class that provides the indexing feature:
class twodstringarray
{
std::vector<std::vector<std::string> > > data;
public:
std::string& operator()(size_t x,size_t y)
{
while(x>=data.size())data.push_back(std::vector<std::string>());
while(y>=data[x].size())data[x].push_back(""):
return data[x][y];
}
};
...
twodstringarray array;
array(100,10)="hello";
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hi,
I tried to capture a WM_MOVING in a CDiaologBar subclass of mine to make it snap to the borders when in floating state.
But apparently ,if my DialogBar is floating, another Miniframe is built around my DialogBar. (or something like that)
How can I delegate the WM_MOVING message from this MiniFrame to DialogBar
without having to start all over again ? (because I really cannot afford the time)
Any help will be much appreciated.
I used to have a life ... now I have a computer
|
|
|
|
|
Hey gus I currently working on a project which change an math expression into a binary tree. But it seems that a stack problem has raised probably because of the stack. I tried to solved the problem but failed. Could someone do me a favor? Thanks!
//Source
#include <ctype.h>
#include <stdlib.h>
#include <stack>
#include <iostream.h>
#include <string>
struct Node
{
char* key;
Node* left;
Node* right;
};
bool ischar(char);
void calculate();
void evaluate(char*);
void inorder(Node*);
std::stack<char> stackOperator;
std::stack<node*> stackOperand;
void main()
{
char infix[50];
Node* node;
cout << "Expression: ";
cin >> infix;
evaluate(infix);
node = stackOperand.top();
cout << "print" << endl;
inorder(stackOperand.top());
}
bool ischar(char ch)
{
return isalpha(ch) || isdigit(ch) || ch == '.';
}
void calculate()
{
//Create a node combined with left and right trees
char op;
Node* temp;
Node* left;
Node* right;
op = stackOperator.top();
stackOperator.pop();
right = stackOperand.top();
cout << "r add: " << right << endl;
stackOperand.pop();
left = stackOperand.top();
cout << "l add: " << left << endl;
stackOperand.pop();
temp = (Node*) malloc(sizeof(Node));
temp->key = &op;
temp->left = left;
temp->right = right;
stackOperand.push(temp);
}
void evaluate(char* infix)
{
int sign = 1, decimal, length;
char variable[20];
bool readyForUnaryOperator = true;
Node* temp;
stackOperator.push('(');
while(*infix != '\0')
{
cout << *infix << endl;
while(isspace(*infix)) infix++;
if(ischar(*infix))
{
//Get number or variable
length = 0;
do
{
variable[length++] = *infix;
infix++;
}
while (ischar(*infix));
variable[length] = '\0';
temp = (Node*) malloc(sizeof(Node)); temp->key = ecvt(atof(variable), strlen(variable), &decimal, &sign);
cout << "variable: " << temp->key << endl;
temp->left = NULL;
temp->right = NULL;
stackOperand.push(temp);
cout << "VAR " << variable << endl;
sign = 1;
readyForUnaryOperator = false;
infix--;
}
else if(*infix == '(')
{
stackOperator.push('(');
readyForUnaryOperator = true;
}
else if(*infix == ')')
{
while(stackOperator.top() != '(')
{
cout << stackOperator.top() << endl;
calculate();
}
stackOperator.pop();
readyForUnaryOperator = false;
}
else if(*infix == '*' || *infix == '/')
{
if(stackOperator.top() == '*' || stackOperator.top() == '/')
calculate();
stackOperator.push(*infix);
readyForUnaryOperator = true;
}
else
{
if(readyForUnaryOperator)
{
if(*infix == '-') sign = -sign;
}
else
{
if(stackOperator.top() != '(')
calculate();
stackOperator.push(*infix);
}
readyForUnaryOperator = true;
}
infix++;
}
while(stackOperator.top() != '(')
calculate();
}
void inorder(Node* root)
{
//Print the tree in inorder form
if(root == NULL)
{
return;
}
inorder(root->left);
cout << *(root->key) << endl;
inorder(root->right);
}
|
|
|
|
|
geeee ... Do remember these pages are html, so watch the < and > (which are written & g t and & l t without spaces) in the includes, and always post a code between <pre> and </pre>. You´ll get 50% more chances to get an answer quickly
~RaGE();
|
|
|
|
|
Innomino wrote:
But it seems that a stack problem has raised probably because of the stack
Lol ... well guessed ... I´ve tried to look into your code, but ... Could you be more specific ? Does your app crash ? When exactly ? Which line in the code you´ve posted ?
~RaGE();
|
|
|
|
|
Hi everyone,
I'm having troubles with some "simple" activeX programming. I'm using MSVC .NET and set up a project as "Simple ATL Control" with a class of "Simple Object". I'm trying to pass a string to this exposed method from java-script or VBScript. Everytime I try to see what the string they passed was, I get only the first char of the string and nothing more. I think I've tried just about everything (except the right thing, obviously). Here's the code :
[source]
// IDL bs
[id(1), helpstring("method ClientWrite")] HRESULT ClientWrite([in] VARIANT report_name, [out,retval] BYTE * bSuccess);
// Later in the same header file
STDMETHOD(ClientWrite)(VARIANT report_name, BYTE * bSuccess);
// Implementation
STDMETHODIMP CATS::ClientWrite(VARIANT report_name, BYTE * bSuccess){
::MessageBox(NULL, (LPCSTR)report_name.bstrVal, (char *) report_name.byref, MB_OK);
return S_OK;
}
[/source]
Why only 1 char? The implemenation code looks a little not uniformed cause I've been messing with it trying to get it to work. Any help is appreciated. Thanks.
|
|
|
|
|
FREAKIN' UNICODE!!!!! BSTR is 16-bits wide....... I suck!
Refernce :
::MessageBoxExW(NULL, report_name, report_name, MB_OK, NULL);
works.
|
|
|
|
|
Hello all, I am having a bit of a problem with databases. Right now I have an application that stores data into an access database. But when the database goes over 2 gigs the application crashes out and it starts over writting the header file. Please give me some suggestions with using other database collectors, that would be a great help. Thanks
|
|
|
|
|
Yes, that's correct, because maximum size of the Access database is 2 gigabytes minus the space needed for system objects. Switch to MS SQL Server.
|
|
|
|
|
Martin,
I do not want it to reside on a server i need it to be independant.
|
|
|
|
|
OK, but you will not get more than 2G data into the Access database. MSDE could be a solution for you, however, check the limits first. I do not know it, I tried MSDE once and it was not good enough for me (it does not support multiple user access very well).
|
|
|
|