|
I used VS to create a new project and compiled the release version. I also got these error messages. I am trying to re-install VS.
Thanks,
|
|
|
|
|
Hi,
I am having a problem declaring and passing a multidimensional array of floats as an argument to a function. Can someone help me with this problem? My code is enclosed.
Any help appreciated.
float* pData = new float[nNumRows,2];
for( int i = 0; i < nNumRows; i++ )
{
pData[i][0] = ((CSodSpecData*)pOdbSpecData)->m_cvData[i].Real();
pData[i][1] = ((CSodSpecData*)pOdbSpecData)->m_cvData[i].Imag();
}
lErrorCode = pService->serviceNotifyDataEventSet( pData[0], strSensorName );
CDFstatus CABCDEntryPointService::serviceNotifyDataEventSet(float* dataSet, const CString& varName)
|
|
|
|
|
Royce Fickling wrote: I am having a problem declaring and passing a multidimensional array of floats
Without knowing what that method requires at the address sent as the first parameter all I can offer is this will compile. No way to know if is correct.
pService->serviceNotifyDataEventSet( pData, strSensorName );
or
pService->serviceNotifyDataEventSet( &pData[0], strSensorName );
|
|
|
|
|
Royce Fickling wrote: float* pData = new float[nNumRows,2];
Should this be:
float pData = new float[nNumRows][2];
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hi
I want to add wide char support to my software. If I do this, I will need to change a lot of code. If the software is changed to wide char, does this wide char software can handle ANSI char as it used to be?
Is there any advice or good experience?
Thanks,
|
|
|
|
|
See [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
|
Rajesh R Subramanian wrote: Note that everything is represented as Unicode, in an application that is built for Unicode.
Not at all true.
"Hello World" is an ANSI string, even in a application build with UNICODE libraries.
L"Hello World" is the UNICODE string in either environment.
_T("Hello World") varies.
Even the underlying API has both Wide and Ansi versions. Sometimes the strings in these are converted. Other times they are not.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
Joe Woodbury wrote: "Hello World" is an ANSI string, even in a application build with UNICODE libraries.
L"Hello World" is the UNICODE string in either environment.
I wouldn't expect anyone reasonable to define strings like this, unless for a debate. My point was that he should not be including ANSI stuff into an Unicode application (why not Unicode?), as that might bring down the performance.
I assume the usage of generic text mapping routines and I could have specified it clearly. Does my comment make sense if string literals enclosed within the TEXT macro?
Rajesh R Subramanian wrote:
Also, if you write an application in ANSI, Windows will still have to convert everything to Unicode internally to work with it. So, theoretically your application must be faster if it is built for Unicode.
Joe Woodbury wrote: Even the underlying API has both Wide and Ansi versions. Sometimes the strings in these are converted. Other times they are not.
It wasn't clear enough that I told "Windows" and not APIs? An API may have both versions, but when it has to pass on a string to Windows, it must be converted to Unicode. Even if a function returns an ANSI string, again, Windows actually returns a Unicode string and there happens another conversion which is not visible to the user calling the API and essentially the performance goes down.
It is a crappy thing, but it's life -^ Carlo Pallini
modified on Sunday, May 17, 2009 2:40 AM
|
|
|
|
|
I have a COM ATL based exe server that supposed to to be a single instance. It generally runs as a windows service. However when I debug it ti doesn't act the way I'd expect. I start it in the debugger. I then have a php script that gets executed by the apache webserver. This php script creates a COM object that is vended out by my COM server. However instead of using the instance of the server that I have running, a new instance is started up, in what appears to be the System account. Is this some weird permissions rule, that because the script is being executed by a process running as a service, that COM creates a second exe server instance in the same security context? Is there way around this? Or is there something blindingly obvious that I'm missing?
|
|
|
|
|
Yes, out of process COM communication is basically permitted only if both sides run in the same security level (if I get it correctly )
Anyway, here is a workaround[^] according to the COM people at MS.
|
|
|
|
|
Nemanja Trifunovic wrote: according to the COM people
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Who are now kept in a small room with no windows and fed corn syrup and creamed spinach. Once a day they are allowed to hold hands and sing "Won't you be my IMoniker?"
|
|
|
|
|
|
CPallini wrote: interperabilty
Italish, Carlo?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Actually a typo (of a poor Italiansh guy... ).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Thanks, that's a great link. It does have the unfortunate side effect of making me want to jab a fork in my eye. What a frigging mess
|
|
|
|
|
Jim Crafton wrote: Thanks, that's a great link. It does have the unfortunate side effect of making me want to jab a fork in my eye.
Pretty normal while working with COM if you ask me.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
|
Mohammadj wrote: Can anyone help me in making it dual function button?!
Probably, but you'll need to post your code snippets here (i.e., only relevant code), rather than require someone to download your whole project from some other site. Some of us have soap operas to watch and Bonbons to eat so time is important.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Welcome to...
Well, you already know [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Here is the code snippet i wrote when the custom button clicked
void CHashiDlg::On_AddSubtract_action()
{
UpdateData( );
double numA ,numB ,result ;
numA = atof(m_num1) ;// edit control number1
numB = atof(m_num2) ;// edit control number2
if(m_two_actions_botn.OnRight()) { // check whether the mouse clicked right half
m_results = numA + numB ;
UpdateData(FALSE );
}
else {
m_results = numA - numB ;
UpdateData(FALSE );
}
UpdateData(FALSE );
}
it performs no action loll
|
|
|
|
|
The first thing I'd do is get rid of those unnecessary UpdateData() calls. They are a never-ending source of problems simply because most folks do not know how to use them.
You should then have something akin to:
void CHashiDlg::On_AddSubtract_action()
{
CString strNumA;
strNumB,
strResult;
m_num1.GetWindowText(strNumA);
m_num2.GetWindowText(strNumB);
double numA = atof(strNumA),
numB = atof(strNumB);
if (m_two_actions_botn.OnRight())
strResult.Format("%f", numA + numB);
else
strResult.Format("%f", numA - numB);
m_results.SetWindowText(strResult);
}
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
|
That tells us a lot.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|