Problem with PipeTest example


#1

Hi. I am trying to compile the PipTest h/cpp in the wxWidgets folder of the pipetest directory with wxWidgets 2.6.3 and VC++ 2005 Express, but I am running into some problems.

Most errors are something like:

c:\program files\opal kelly\frontpanel\frontpanelhdl\samples\pipetest\wxwidgets\pipetest.cpp(440) : error C2664: ‘okCUsbFrontPanel::ConfigureFPGA’ : cannot convert parameter 1 from ‘const wxChar *’ to ‘const std::string’
No constructor could take the source type, or constructor overload resolution was ambiguous

and the line that is causing that error is:

m_xem->ConfigureFPGA(bitfilename.c_str());

is it a problem with my wxwidget version??? c_str() should work right?

to get around the problem above i tried:

m_xem->ConfigureFPGA((const char*)bitfilename.mb_str(wxConvUTF8));

this compiles and the gui works, but when I try to load a bit file, it causes this error:

Unhandled exception at 0x7c9012b4 in beta 1.0.exe: 0xC0000005: Access violation reading location 0x00000028.

help please?

Evan


#2

also, if i set the bit file variable to a static value under gotdevice:

m_xem->ConfigureFPGA(“C:/3d.bit”);

I get this error:

Unhandled exception at 0x7c9012b4 in beta 1.0.exe: 0xC0000005: Access violation reading location 0x00000010.


#3

Evan-

okCUsbFrontPanel::ConfigureFPGA() takes a std::string, not a char *.

Try:

m_xem->ConfigureFPGA(new std::string(yourstr.c_str()))

#4

That did not work either, but this did:

(const char*)bitfilename.mb_str(wxConvUTF8)