|
Hi
I have two questions
1. Is there any way to retrieve information about toolbar resources (number of buttons, their ID's and images) without loading them into CToolBar object?
2. If look at VS .NET menu (which is actually a toolbar) you can notice that there is a one pixel distance between items, so if you move mouse over it no item will be selected. How it could be done?
________________________
Best regards,
v0id
|
|
|
|
|
Ok, im trying to work with g++ here so i can get used to it. I've written a simple code that uses classes and whatnot. I'm setting variables in the classes using functions like
void myclass::setvariable(int my_variable)
{
Variable = my_variable;
}
Where my_variable is passed into the function and a private variable, Variable, is set equal to it.
This works all fine and dandy in VS.net, however, when compiling in g++, im getting errors. like
Undefined first referenced
symbol in file
This only happens with my g++ compiler, not in VS.net. Any suggestions? Or does g++ not like void functions?
*.*
cin >> knowledge;
|
|
|
|
|
Whats the exact error? Have you included the definition for myclass? Functions returning void are completley standard C/C++, and every compiler (including g++) should handle them
|
|
|
|
|
Here is the error
g++ proj01.cpp
Undefined first referenced
symbol in file
Player::SetFirst(std::string) /var/tmp/ccZLDByc.o
ld: fatal: Symbol referencing errors. No output written to a.out
collect2: ld returned 1 exit status
Here is (part of) my .h file:
#include <string>
#include <vector>
using namespace std;
class Player
{
public:
string GetFirst();
void SetFirst(string first);
private:
string FirstName;
};
Here is my .cpp file for the header...
#include "player.h"
#include <string>
using namespace std;
string Player::GetFirst()
{
return FirstName;
};
void Player::SetFirst(string first)
{
FirstName = first;
};
this only happens with void functions. In GetFirst(), i return a string, and it works fine.
*.*
cin >> knowledge;
|
|
|
|
|
keegan wrote:
#include "player.h"#include using namespace std;string Player::GetFirst(){ return FirstName;};void Player::SetFirst(string first){ FirstName = first;};
Why are you including a semi-colon after the end of each function body in your player.cpp file, you don't need that.
-Nick Parker
|
|
|
|
|
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!
|
|
|
|