Valhalla Legends Forums Archive | C/C++ Programming | Resources

AuthorMessageTime
BreW
Okay, how do I use a resources from a resource file? (especially icons) It seems no matter what I do, it just doesn't work. I've made the resource.h file, (named specifically that), and defined the resources like this:
[code]
#define IDI_ICON 1001
#define IDI_ICONSMALL 1002
[/code]
where the constant's names match the names of the resources within the resource file.
Then i included that .h file in my other file, and when registering the window class just used those names for the icons. (IDI_ICON, IDI_ICONSMALL, etc) You'd think that would work right? Well it DOESNT. I'm so frustruated right now, can anyone help me? Also it's now giving me some gay error that there's an "unexpected end of the file" for my .rc file. This is just total bullshit, I feel like MS is doing this to me (and maybe other people) on purpose. I've even checked the example hello world window that is included with VC++ and it does nothing different. This is completely pissing me off, (about how it doesnt work for just me) and I don't get what i'm doing wrong. can anyone help??
July 18, 2007, 9:11 PM
l2k-Shadow
Can you post the link to your project?

the unexpected end of file is probably you not including the precompiled header file (stdafx.h). you can turn mandatory including of that file in your VC++ project settings. the unrecognizing of the constants might be due to the unexpected end of file error as well.
July 18, 2007, 10:46 PM
BreW
Ah nevermind my problem was that i didn't know VC++ makes a resource.h file by itself, and i made one (which overwrote it) and apparently the .rc file reads something from the resource.h file? that would make it give the error. Anyways I figured out what i'm doing wrong, but not quite. When I use the constants in resource.h (created automatically btw) it makes a question mark icon instead of what i want (the one i included as an icon....) I don't think stdafx.h has anything to do with it by the way (i started from a blank project and just never included it). This is complete bullshit, I'm getting tired of struggling with some gay icon. :l
July 19, 2007, 12:55 AM
Yegg
Don't give up on that icon, it's actually quite easy once you get the hang of it.

Question: Why not get into .NET?
July 19, 2007, 3:03 AM
BreW
[quote author=Yegg link=topic=16893.msg171093#msg171093 date=1184814230]
Question: Why not get into .NET?
[/quote]
I had a bad childhood experience with .NET
and it's slow

I think I got the icon, I made it a numerical resource name and that (kinda) worked, it shows up in the tray icon and the taskbar icon, but it just doesn't show up on the application bar of the window for some reason also winsock2.h is giving me a bunch of crap, it says i have 58 errors and 11 warnings, and without defining it, it says two functions are undeclared identifiers (even though i think it's included in windows.h) god help me .... :(
July 19, 2007, 3:39 AM
Yegg
.NET isn't that slow. Besides, software should be concerned more with productivity as opposed to raw speed. Unless you're developing some kind of high performance interpreter, some compiler, or another software which should have absolute speed, which I know you aren't, productivity should be more important.
July 19, 2007, 4:26 AM
l2k-Shadow
[quote author=brew link=topic=16893.msg171094#msg171094 date=1184816389]
I think I got the icon, I made it a numerical resource name and that (kinda) worked, it shows up in the tray icon and the taskbar icon, but it just doesn't show up on the application bar of the window for some reason also winsock2.h is giving me a bunch of crap, it says i have 58 errors and 11 warnings, and without defining it, it says two functions are undeclared identifiers (even though i think it's included in windows.h) god help me .... :(
[/quote]

lol man seriously try searching some tuts before attempting to code something like winsock.

include WS2_32.lib in your project.
July 19, 2007, 5:33 AM
BreW
[quote author=l2k-Shadow link=topic=16893.msg171098#msg171098 date=1184823208]
[quote author=brew link=topic=16893.msg171094#msg171094 date=1184816389]
I think I got the icon, I made it a numerical resource name and that (kinda) worked, it shows up in the tray icon and the taskbar icon, but it just doesn't show up on the application bar of the window for some reason also winsock2.h is giving me a bunch of crap, it says i have 58 errors and 11 warnings, and without defining it, it says two functions are undeclared identifiers (even though i think it's included in windows.h) god help me .... :(
[/quote]

lol man seriously try searching some tuts before attempting to code something like winsock.

include WS2_32.lib in your project.
[/quote]

And how would i do that? I tried #pragma comment (lib, "WS2_32.LIB") but it gave me the same thing. As for actually adding it to the source files of your project... i've never heard of anyone having to do that, or even saw anyone doing that for a winsock connection.
July 19, 2007, 2:27 PM
Yegg
I haven't used VC++ in ages, but the IDE does have a feature for adding files to the project. Add the WS2_32.lib file to your project. It's no special task; it's very simple.
July 19, 2007, 4:25 PM
BreW
[quote author=Yegg link=topic=16893.msg171105#msg171105 date=1184862303]
I haven't used VC++ in ages, but the IDE does have a feature for adding files to the project. Add the WS2_32.lib file to your project. It's no special task; it's very simple.
[/quote]

How do I include it in my project? Its obviouly somewhere in the Insert menu item, but where...? in Include text file it doesn't even show .lib files as an option, and the only other things are resources..... not so simple, huh
July 19, 2007, 5:55 PM
Yegg
[quote author=brew link=topic=16893.msg171106#msg171106 date=1184867754]
[quote author=Yegg link=topic=16893.msg171105#msg171105 date=1184862303]
I haven't used VC++ in ages, but the IDE does have a feature for adding files to the project. Add the WS2_32.lib file to your project. It's no special task; it's very simple.
[/quote]

How do I include it in my project? Its obviouly somewhere in the Insert menu item, but where...? in Include text file it doesn't even show .lib files as an option, and the only other things are resources..... not so simple, huh
[/quote]

Which software are you using?
July 19, 2007, 7:04 PM
BreW
visual c++...
July 19, 2007, 7:47 PM
Yegg
[quote author=brew link=topic=16893.msg171108#msg171108 date=1184874452]
visual c++...
[/quote]

Way to go fucking genius!? There's more than one version, idiot.

If you're using VC++ 6, then go to Project > Add to Project > Files... and add the WS2_32.lib file.

July 19, 2007, 8:23 PM
BreW
[quote author=Yegg link=topic=16893.msg171109#msg171109 date=1184876618]
[quote author=brew link=topic=16893.msg171108#msg171108 date=1184874452]
visual c++...
[/quote]

Way to go fucking genius!? There's more than one version, idiot.

If you're using VC++ 6, then go to Project > Add to Project > Files... and add the WS2_32.lib file.


[/quote]

"hyyyy im yegg i wonder what VERSION of visual C++ you're using"

[quote]
Which software are you using?
[/quote]

Yes. VC++ 6.
July 19, 2007, 9:01 PM
Yegg
[quote author=brew link=topic=16893.msg171110#msg171110 date=1184878906]

"hyyyy im yegg i wonder what VERSION of visual C++ you're using"

[quote]
Which software are you using?
[/quote]

Yes. VC++ 6.
[/quote]

What does that even mean? What version am I using? I don't use VC++. I mentioned that I haven't used it in ages. Earlier when I didn't specify it was because I didn't have to. I don't use any VC++ and both of them have that same feature. Therefore, my statement was completely correct. You couldn't figure out how to add the file so I asked which version you used, apparently you didn't know they had a version judging by your response... It's a few extremely simple steps that you considered "not so simple".
July 20, 2007, 1:32 AM
BreW
[quote author=Yegg link=topic=16893.msg171111#msg171111 date=1184895132]
[quote author=brew link=topic=16893.msg171110#msg171110 date=1184878906]

"hyyyy im yegg i wonder what VERSION of visual C++ you're using"

[quote]
Which software are you using?
[/quote]

Yes. VC++ 6.
[/quote]

What does that even mean? What version am I using? I don't use VC++. I mentioned that I haven't used it in ages. Earlier when I didn't specify it was because I didn't have to. I don't use any VC++ and both of them have that same feature. Therefore, my statement was completely correct. You couldn't figure out how to add the file so I asked which version you used, apparently you didn't know they had a version judging by your response... It's a few extremely simple steps that you considered "not so simple".
[/quote]

I ment to say that you asked what "software" i am using, well uh, that'd be MSVC++. What you should have said is what version I am using... you flipped out about something simple like that. Wow you get raged way too quick. By the way, adding WS2_32.lib didn't help at all.
July 20, 2007, 2:08 AM
Yegg
[quote author=brew link=topic=16893.msg171113#msg171113 date=1184897304]

I ment to say that you asked what "software" i am using, well uh, that'd be MSVC++. What you should have said is what version I am using... you flipped out about something simple like that. Wow you get raged way too quick. By the way, adding WS2_32.lib didn't help at all.
[/quote]

No. I'm not "raged". I'm annoyed that you can't seem to figure out something so simple (ie. me asking which software you were using). When someone asks you which software you were using, specify the exact version (there are differences between versions). VC++ 6 and 7 and 8 are all different. Adding WS2_32.lib does help. You clearly did something else incorrect as well.
July 20, 2007, 2:59 AM
warz
one thing i have failed to see in this entire thread is some code. how are we supposed to help without code snippets? it sounds like you're including everything required, so it's a code issue. also, if you feel like it's "just you" experiencing an issue, that's probably a sign that it isn't C++'s fault, or whoever you blamed in your first post - it's probably you doing something wrong. (which we all probably assume when reading a post by you, anyways)
July 20, 2007, 5:44 AM
BreW
[quote author=betawarz link=topic=16893.msg171115#msg171115 date=1184910281]
one thing i have failed to see in this entire thread is some code. how are we supposed to help without code snippets? it sounds like you're including everything required, so it's a code issue. also, if you feel like it's "just you" experiencing an issue, that's probably a sign that it isn't C++'s fault, or whoever you blamed in your first post - it's probably you doing something wrong. (which we all probably assume when reading a post by you, anyways)
[/quote]

Warz, if you had read the entire topic you would have realized I got the icon (partially) working ages ago. I also found a solution to my winsock problem -- don't use winsock 2.2.
July 21, 2007, 5:06 PM
Yegg
[quote author=brew link=topic=16893.msg171135#msg171135 date=1185037603]
[quote author=betawarz link=topic=16893.msg171115#msg171115 date=1184910281]
one thing i have failed to see in this entire thread is some code. how are we supposed to help without code snippets? it sounds like you're including everything required, so it's a code issue. also, if you feel like it's "just you" experiencing an issue, that's probably a sign that it isn't C++'s fault, or whoever you blamed in your first post - it's probably you doing something wrong. (which we all probably assume when reading a post by you, anyways)
[/quote]

Warz, if you had read the entire topic you would have realized I got the icon (partially) working ages ago. I also found a solution to my winsock problem -- don't use winsock 2.2.
[/quote]

...How does that even relate to what warz said?

How is that a solution by not using Winsock 2.2?
July 21, 2007, 8:04 PM
BreW
[quote author=Yegg link=topic=16893.msg171138#msg171138 date=1185048291]
[quote author=brew link=topic=16893.msg171135#msg171135 date=1185037603]
[quote author=betawarz link=topic=16893.msg171115#msg171115 date=1184910281]
one thing i have failed to see in this entire thread is some code. how are we supposed to help without code snippets? it sounds like you're including everything required, so it's a code issue. also, if you feel like it's "just you" experiencing an issue, that's probably a sign that it isn't C++'s fault, or whoever you blamed in your first post - it's probably you doing something wrong. (which we all probably assume when reading a post by you, anyways)
[/quote]

Warz, if you had read the entire topic you would have realized I got the icon (partially) working ages ago. I also found a solution to my winsock problem -- don't use winsock 2.2.
[/quote]

...How does that even relate to what warz said?

How is that a solution by not using Winsock 2.2?
[/quote]

Warz was talking about my problem in the first post, so i told him i got that working, and he was also talking about my winsock2.h problem, and i told him my solution for that. So anotherwords everything's just A-OK, i don't need any help with that anymore.

Its a solution because i'm able to continue on with my application without an error stopping me

I don't get why any of that matters though, yegg?
July 21, 2007, 9:14 PM
Yegg
warz said that you failed to show code. He didn't tell how to fix the problem. He said what you should have done in the first place when you needed help.

If you're not using Winsock 2.2, then what are you using?

It matters because you seem to have misunderstood what he said.
July 22, 2007, 1:15 AM
Explicit[nK]
[quote author=Yegg link=topic=16893.msg171143#msg171143 date=1185066915]
warz said that you failed to show code. He didn't tell how to fix the problem. He said what you should have done in the first place when you needed help.

If you're not using Winsock 2.2, then what are you using?

It matters because you seem to have misunderstood what he said.
[/quote]

Or you're making mountains out of molehills.
July 22, 2007, 10:41 AM
BreW
[quote author=Yegg link=topic=16893.msg171143#msg171143 date=1185066915]
If you're not using Winsock 2.2, then what are you using?
[/quote]
Winsock 1.1. (0x101 for my requested version in WSAStartup)
July 22, 2007, 3:24 PM
l2k-Shadow
i would still look into your code, i use winsock 2.2 and it works just fine. Don't expect your program to work well in the long run just because you fill it with bad workarounds and unstable solutions.
July 22, 2007, 3:59 PM

Search