|
I just tried your example in g++ (GCC 3.2.3), and it compiled and linked just fine (using the following main() ).
#include "player.h"
int main(int argc,char **args) {
Player player;
player.SetFirst("foo!");
return 0;
}
- Mike
|
|
|
|
|
I used my player cpp and h files, with your main, and i got the error:
Undefined first referenced
symbol in file
Player::SetFirst(std::string) /var/tmp/ccF4AOmw.o
ld: fatal: Symbol referencing errors. No output written to a.out
collect2: ld returned 1 exit status
:'(
are you using a new version of g++? i heard that older versions have trouble with void main() things, i wonder if its the same thing here?
Im wondering if its something wrong with the command im entering... Im just putting in "g++ thing.cpp" thing.cpp is my driver (has the main). Do i need to do anything else? I tried a makefile, but it gave the same erorrs.
*.*
cin >> knowledge;
|
|
|
|
|
I just tried it using g++ from GCC 2.95.3, and it still compiled and linked fine, using: g++ -o player player.cpp main.cpp
Very strange... I don't see anything wrong with the code snippets, and it's also weird that it's the linker that's complaining...
- Mike
|
|
|
|
|
yay! i changed absolutely nothing and it works wonderfully now!
yipeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee!
goddamn, unix is just as bad as windows.
Thanks for all your help, i appreciate it a lot.
*.*
cin >> knowledge;
|
|
|
|
|
hi
can you help me about how can i open and read and write in USB port with visualc++ programming ?
thanks alot
|
|
|
|
|
asd1753 wrote:
can you help me about how can i open and read and write in USB port with visualc++ programming ?
Well, you can't. USB port is only gateway to devices that you control. Each device installs driver that you talk to. Many devices use the generic HID driver, download the ddk for docs/code.
|
|
|
|
|
how can i write a driver for my device in using USB port ?
|
|
|
|
|
asd1753 wrote:
how can i write a driver for my device in using USB port ?
Check Windows ddk. I recommend using the built-in hid driver and modify the device to support it.
|
|
|
|
|
like on windows paint, the text feature, where it places text anywhere on the painting surface, how would i do this ?
and then, how would i add resizing properties to my rectagles lines and ellipses
thanx
smile...its your destiny
|
|
|
|
|
CDC::TextOut() or any of the other variants.
For the resizing you will have to hit test the mouse click against the list of items you draw, if it is within your hit test bounds then you have a hit and move to editing mode for the item. Store the details that you use to draw the item, and as the mouse moves, erase the item as it was, quick way to do it is via an XOR drawing operation. Draw the new item at the new position. On mouse up, commit the new positions to the store. You will have to worry about which item to select on the hit test. Think of each item being created as being on a stack, hit-test working down the stack. If two items are possible hits, then it is the more newly created (ie on top) item that will be selected. then you will have to do a move to back, bring to front mechanism, but that is simple.
HTH,
Steve.
if(E_NOINTERFACE == pThat->QueryInterface(IID_IUnknown,(void**)&pUnk))
{
// I aint no pUnk bitch!
}
|
|
|
|
|
Is there some way to append one string at begin of another? using STL or W32API not MFC
|
|
|
|
|
<br />
char string1 = "Hello";<br />
char string2 = "I am scolinks";<br />
<br />
strcat(string1,string2);<br />
<br />
SetDlgItemText(hwnd,IDC_APPENDED, string1);<br />
<br />
I hope this helps....
Well... I am a beginner ...
|
|
|
|
|
strcat() appends string2 to end of 1st string
i need some function which does opposite.
but thanks anyway.
|
|
|
|
|
Duh
strcat(string2,string1);
See msdn Library[^]
John Hudson
An imaginary Chris Maunder standing in front of mirror is misquoted remarking: Nothing says "you're not normal" more than the little things.
http://www.rainbow-innov.co.uk[^]
|
|
|
|
|
|
Maybe I'm missing the point of your question?
std::string orig = "foo";
std::string ins = "String to insert at beginning ";
std::string combined = ins + orig;
- Mike
|
|
|
|
|
This is exactly what i need.
|
|
|
|
|
1. i would like to know about mouse control that i can command "double click" for open "my computer" on my desktop
2. i would like to know the name of even for system key such as i press on keyboard "CTRL+SHIFT+P"......... i guess that WM_SYSKEYDOWN but not appear in even when i press "CTRL+SHIFT+P"?
thank a lot....
|
|
|
|
|
Hi all,
I would like to check the attributes of a file's (e.g date, time) creation.
I am sure it is possible but I just dont know how?
I am writing an application in VC++ .NET which would search for file in a specified folder and the results will be shown in chronical order.
I can search the file but I can't show the output in chronical order .
I would really appreciate if someone can help me out.
Thanks
Dilshad
|
|
|
|
|
If you're using FindFirstFile /FindNextFile to do the searching, those APIs return the created/modified/accessed times in the WIN32_FIND_DATA struct. Otherwise, you can call GetFileTime() to get those.
--Mike--
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
Ericahist updated (again) Sep 6!
|
|
|
|
|
i wrote the following:
void CText_dialogDlg::OnSearch()
{
CString buffer;
FILE *stream;
char target[80],etchant[80],conc[300];
char name[80];
int temp;
int m_itemp;
float etchrate;
// float m_fetchrate;
CString name_str;
CString eof = "EOF";
CString m_strTarget;
CString m_strConc;
CString m_strEtchant;
CString searchkey;
stream = fopen( "e:\\fyp_2003\\database.txt", "r" );
searchkey=m_strkey;
do
{
fscanf( stream, "%s", name );
fscanf( stream, "%s", target );
//fscanf( stream, "%s", process );
fscanf( stream, "%s", etchant);
fscanf( stream, "%s", conc);
fscanf( stream, "%d", &temp );
fscanf( stream, "%f", &etchrate );
name_str = name;
}while (name_str != searchkey);
/* Output data read: */
CString str;
str.Format("%s %s %s %s %d %f",name,target,etchant,conc,temp,etchrate);
m_dialog_etch.m_strTarget = target;
//m_dialog_etch.m_str_process = process;
m_dialog_etch.m_strEtchant = etchant;
m_dialog_etch.m_itemp = temp;
m_dialog_etch.m_fetchrate = etchrate;
m_dialog_etch.m_strConc = conc;
UpdateData(FALSE);
m_dialog_etch.DoModal();
fclose( stream );
}
but my dialog_etch din appear, instead the program hanged.
i have 2 dialogs, dialog1 and dialog_etch, when user key in the edit box, my dialog etch will retrieve the info from a txtfile.
|
|
|
|
|
dialog1 is my text_dialogDlg
|
|
|
|
|
hi!
where is onsearch() called in? Maybe you have called this function in other procedure actived by EN_SETFOCUS message.
dupengfei
|
|
|
|
|
coda_x wrote:
do {
fscanf( stream, "%s", name );
fscanf( stream, "%s", target );
fscanf( stream, "%s", etchant);
fscanf( stream, "%s", conc);
fscanf( stream, "%d", &temp );
fscanf( stream, "%f", &etchrate );
name_str = name;
}while (name_str != searchkey);
This loop is where your program is hanging. If you never read a value where name_str==searchkey , the loop will continue forever. Eventually you will reach the end of file, and the fscanf functions will return errors.
Software Zen: delete this;
|
|
|
|
|
thanx! i solved that but now i have another problem, i use 2 if statements which contain different searchkey, so by right, my dialog_etch should display different information depending on the searchkey but it kept displaying the same info to mi...:
if(strcmp(buffer,"Wet etch Al H3PO4") == 0)
{
CString search = "Wet1";
/* Read data back from file: */
do
{
fscanf( stream, "%s", name );
fscanf( stream, "%s", target );
fscanf( stream, "%s", process );
fscanf( stream, "%s", etchant);
fscanf( stream, "%s", conc);
fscanf( stream, "%d", &temp );
fscanf( stream, "%f", &etchrate );
name_str = name;
}while (name_str != search);
/* Output data read: */
CString str;
str.Format("%s %s %s %s %s %d %f",name,target,process,etchant,conc,temp,etchrate);
m_etchDlg.m_str_target = target;
m_etchDlg.m_str_process = process;
m_etchDlg.m_str_etchant = etchant;
m_etchDlg.m_f_etchrate = etchrate;
m_etchDlg.m_str_conc = conc;
m_etchDlg.m_temp = temp;
UpdateData(FALSE);
m_etchDlg.DoModal();
fclose( stream );
}
if(strcmp(buffer,"Wet etch Al H3PO4/HF") == 0)
{
CString search = "Wet2";
/* Read data back from file: */
do
{
fscanf( stream, "%s", name );
fscanf( stream, "%s", target );
fscanf( stream, "%s", process );
fscanf( stream, "%s", etchant);
fscanf( stream, "%s", conc);
fscanf( stream, "%d", &temp );
fscanf( stream, "%f", &etchrate );
name_str = name;
}while (name_str != search);
/* Output data read: */
CString str;
str.Format("%s %s %s %s %s %d %f",name,target,process,etchant,conc,temp,etchrate);
m_etchDlg.m_str_target = target;
m_etchDlg.m_str_process = process;
m_etchDlg.m_str_etchant = etchant;
m_etchDlg.m_temp = temp;
m_etchDlg.m_f_etchrate = etchrate;
m_etchDlg.m_str_conc = conc;
m_etchDlg.m_temp = temp;
UpdateData(FALSE);
m_etchDlg.DoModal();
fclose( stream );
}
is there anything wrong with it?
|
|
|
|
|