|
Sorry if the question makes no sense. That was obviously my fault, i won't be doing that again. Next time i'll be in a position to talk down to a newbie on this subject.
So next stupid question: if the language is no longer relevant then is the
machine language of linux compatible with windows?
I wouldn't have thought so but you can suprise me.
Basically i'm after a language that i'll be able to use cross-platform ...
|
|
|
|
|
Ylno wrote: ...is the
machine language of linux compatible with windows?
No, they use different instruction sets. High-level code can be ported from one platform to the other, though. You'll just need a compiler on each to create the machine code.
See here for more.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Thanks Dave,
You've cleared things up.
|
|
|
|
|
Ylno wrote: is the
machine language of linux compatible with windows?
Linux (or Windows) doesn't have a machine language, machine language is a feature of the processor chip and it's independent of any OS you may be running.
Ylno wrote: Basically i'm after a language that i'll be able to use cross-platform
C, C++, Java, Python, Ruby, Perl, ...
|
|
|
|
|
good answer!
|
|
|
|
|
Hello, I'm having a bit of trouble and was hoping you guys would be able to help me out. Right now I have a function that produces a 2 arrays with number used from graphing. In the OnPaint part for the dialog box I simply used the MoveTo and LineTo to graph. In order for both functions to get at those arrays I put at the top of the code(like how I would with a global varible in C). But now that program will crash when I run that function twice because of the painting. Any ideas of how to solve this, am I declaring the arrays in the wrong place?
Thanks
|
|
|
|
|
Are the arrays initialized at the time the first WM_PAINT message is received?
What does the code look like where the crash occurs?
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
No they are initilized after the WM_PAINT. The code crashes when I access the arrays for the second time to paint, If I comment out the paint code the program will just fine. The code looks like this where is crashes, where x_prime2 and Ey_x2 are the arrays
for(int i=0; i<=999; i++){
x = (30+scale2*x_prime2[i]);
y = (scale1*Ey_x2[i].Real());
if(i == 0){
dc.MoveTo(int(x+min_1*(-1)*scale2), int(y*(-1)+640));
}
else{
dc.LineTo(int(x+min_1*(-1)*scale2), int(y*(-1)+640));
}
}
And I initilize them like this
#include "stdafx.h"
#include <math.h>
#include "complex.h"
#include <complex>
int Nglobal;
int *layerglobal = new int [100];
double *thickglobal = new double [100];
Complex *Ey_z_C2=new Complex [1000];
Complex *Ey_z_L2=new Complex [1000];
Complex *Ey_x2= new Complex [1000];
Complex *z_prime2=new Complex [1000];
double *x_prime2=new double [1000];
|
|
|
|
|
I can't see anything off hand....are you getting a floating point exception?
How is it crashing?
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Also, you ARE putting valid values into the arrays before calculations are done on the values,
right?
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Yes the values that are being put in are valid, I do not know what a floating point exception is though. The program runs just fine in debug, which is driving me crazy I just can't get the release version to work. Do you think it could have something to do with the compiler options? Is there a way I can paint directly from the function instead of using the OnPaint function?
Thank you very much!
|
|
|
|
|
You can have debug info on your release build and run it in the debugger.
That's still the easiest and best way to find the offending line of code
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
I have found my problem, the array was being over written I dunno how, The array was set to be N+1, and then I did a loop from (i=0; i
|
|
|
|
|
Hi,
I have a .DLL I compiled (in C# in .NET), and added as a reference to a Visual C++ project in .NET. Now I need to be able to access its members somehow. Both library and its namespace are called HyTest, however HyTest:: or HyTest. yeild nothing. Is there a specific way to access members of a DLL (written in C#) compiled in .NET?
wbr,
Victor
|
|
|
|
|
*bump*
sorry if this comes across inconciderate =\ I am on a pretty tight timeframe so any help would be much appriciated
|
|
|
|
|
It's a well known bug: The Month Calendar returns a false Date...
Does somebody know a bugfix or a workaround for this problem? (I'm sorry if a thread already exists but the search found nothing that looked good...)
|
|
|
|
|
What's the bug? Have a link?
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Just try this little code:
void CTodolisteDlg::OnSelectkalender(NMHDR* pNMHDR, LRESULT* pResult){
UpdateData(true);
m_tag = m_datetime.Format( "%A, %B %d, %Y" );
UpdateData(false);
}
(m_tag is the membervariable (string) of a textbox and m_datetime is the membervariable (CTime) of the Month Calendar)
In your textbox will be written an other date then you have selected...
-- modified at 14:23 Thursday 21st June, 2007
|
|
|
|
|
It works for me but I'm on VS 2003 (MFC 7.1). I suppose the bug was/is in CTime somewhere?
For a workaround, maybe use the actual SYSTEMTIME of the NMSELCHANGE struct passed in the
notification and use a "better" date/time class...
void CTodolisteDlg::OnSelectkalender(NMHDR* pNMHDR, LRESULT* pResult)
{
NMSELCHANGE *pNMSelChange = (NMSELCHANGE *)pNMHDR;
COleDateTime OleDateTime(pNMSelChange->stSelStart);
<code>
m_tag = OleDateTime.Format( "%A, %B %d, %Y" );
UpdateData(false);
}
-- modified at 14:47 Thursday 21st June, 2007
*edit* Ooops
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Sorry, i'm a "noob" in MFC...
I don't understand how to use this example above, but when I compile it simply it doesn't works cause now is m_datetime not changed...
that means that the selected date is fix set to the inital-value of m_datetime...
Are there alternative calendars that works well for VC++?
|
|
|
|
|
See the fixed code - I messed it up and left your variable in there.
Sorry about that
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
I don't understand your Code but it works!
Can you explain what those lines do:
NMSELCHANGE *pNMSelChange = (NMSELCHANGE *)pNMHDR;
COleDateTime OleDateTime(pNMSelChange->stSelStart);
(Cause i want to learn something^^)
Thank you!
You saved my project^^
|
|
|
|
|
// Cast the passed NMHDR pointer to a NMSELCHANGE pointer, which is the type
// of structure passed in a MCN_SELECT notification
NMSELCHANGE *pNMSelChange = (NMSELCHANGE *)pNMHDR;
// Create a COleDateTime object from NMSELCHANGE.stSelStart (which is a SYSTEMTIME struct)
// using the COleDateTime(SYSTEMTIME&) constructor
COleDateTime OleDateTime(pNMSelChange->stSelStart);
// use the COleDateTime::Format() method to create a CString representation of the date
...
I don't have access to the MFC code for version 4.x (VC 6) so I'm not sure what the actual bug is.
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Hi All,
I am trying to implement the behavior of SysListView32 using ListView.
When a folder is selected in TreeView, i'm retrieving visible columns for current selection
using the following code:
<br />
SHELLDETAILS sd;<br />
LPTSTR pszHeader=NULL;<br />
CString sColumns;<br />
for(int i=0;SUCCEEDED(m_ShellDetails.GetDetailsOf(NULL,i,&sd));i++)<br />
{<br />
GetShellPidl().StrRetToStr(sd.str,&pszHeader,NULL);<br />
if (pszHeader)<br />
{<br />
TRACE1("Column found %s\n",pszHeader); <br />
if (!sColumns.IsEmpty())<br />
sColumns += _T("|");<br />
sColumns += pszHeader;<br />
GetShellPidl().Free(pszHeader);<br />
pszHeader= NULL;<br />
}<br />
}<br />
return sColumns;<br />
Because normal file system folders have columns like Name, Size, Type and Date Modified,
while Control Panel has columns like Name and Comments.
I am successfully enumerating ALL the columns, but i need to know how to determine whether to make a particular column visible or not. Because a user may determine which columns he/she want to view.
Please Help.
---------------
Never loose hope...
|
|
|
|
|
a_b_pathak wrote: I am trying to implement the behavior of SysListView32 using ListView.
What exactly do you mean? The underlying window class of CListView is SysListView32 .
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|