15,918,808 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by FatalCatharsis (Top 68 by date)
FatalCatharsis
29-Nov-11 17:42pm
View
alrighty then. good to know :P
FatalCatharsis
29-Nov-11 16:56pm
View
interesting. didn't think it would be that simple :\ . isn't that what the:
#ifndef BASE_H
#define BASE_H
...
#endif
does? Like, once it's included once then BASE_H is defined, and then it won't cycle through it again?
FatalCatharsis
29-Nov-11 13:32pm
View
it is because m_Map is defined statically. If that line is omitted, the static functions inside the class no longer have access to the m_Map member. So it's declared globally. I get undefined reference errors otherwise. I need only one single map object even though there is multiple derivedRegister objects. Defined statically, the map object is the same object for all instances of derivedRegister.
FatalCatharsis
20-Nov-11 13:19pm
View
Okay, i've just been frustrating over this all morning, and just now, after doing the same thing for like 12 compiles, it suddenly worked. I can't remember changing anything between these compiles. It just works. So now i'm just gonna go grab a coffee and some aspirin and get on with my day. Thanks for your assistance guys.
FatalCatharsis
20-Nov-11 12:42pm
View
okay, i found something new that i'm confused by. when i removed the WS_CHILD style and then made the parent parameter NULL, the window was created fine, off to the side of my main window. That's cool, but this needs to be a control, and needs to be a child window. Can you all think of any reason why it wouldn't be aloud to be parented by the main window?
FatalCatharsis
20-Nov-11 12:25pm
View
This did not work either :\
FatalCatharsis
20-Nov-11 12:15pm
View
GetLastError() return 0 so that's no help :\
FatalCatharsis
20-Nov-11 12:14pm
View
no dice :\
FatalCatharsis
19-Nov-11 22:28pm
View
void NameListControl::Create() calls the CreateWindowEx. these are just a couple source files that contains the class, i have this massive other application, which i didn't link where i do create an instance of the class globally, call init within winmain, and then create in the WM_CREATE message of the wndproc of my main window class.
FatalCatharsis
18-Nov-11 14:10pm
View
wow, knowing that would have solved a TON of problems i've had in the past. Even more thanks to you :P
FatalCatharsis
18-Nov-11 13:39pm
View
actually, wait no. i'm not able to check right now, but wouldn't that require a for loop that would loop over and over, and suck up my cpu? cause that's one of the problems i had with non-blocking sockets. it would constantly cycle and see if anything was available, and would always use 100% cpu :\ .
FatalCatharsis
18-Nov-11 13:33pm
View
Perfect, that's exactly what i'm looking for. Thanks a bunch!
FatalCatharsis
17-Nov-11 11:47am
View
oh wow, never knew that, you get accepted solution too. thanks again :)
FatalCatharsis
17-Nov-11 11:44am
View
yeh it's all cleared up now, thanks a bunch!
FatalCatharsis
17-Nov-11 11:43am
View
whoa, not an answer collision, this helped me understand what thaddeus jones, was trying to say, strcpy treats the high byte like a null character, and it thinks the string only contains a 2. i get it now, and i can totally fix that. thank you both! chuck, i'm gonna accept Thadeus here's solution cause he was first, :\ but you definately get a 5 star for helping me understand :P thank you both!
FatalCatharsis
17-Nov-11 11:26am
View
no wait, what i meant was, s1 prints out "(smileyface)oh hai hello wassup?" and s1[2] was the null character before strcat. i stick that null character on the end so strcat works properly. in the end, the null character is after the question mark. so wait, a short has 3 bytes in it? cause i thought it was only two bytes and short 1 would have the bytes {2, 0} ? also the first character wouldn't be 2 would it? it would be a byte containing the numerical value 2 right? like 0x02h?
FatalCatharsis
17-Nov-11 11:06am
View
ah cool, thank you :P
FatalCatharsis
15-Nov-11 14:18pm
View
ah, yeh, that makes sense, cause later calls to send and recv work just fine with the server, even with that error. i guess it just takes a sec to connect.
FatalCatharsis
14-Nov-11 22:08pm
View
BWAHAHAHA, okay, get this. you see where i call SendDlgItemMessage() ? look at that last parameter and the way i cast it, or at least TRIED to cast it. lParam is the variable LPARAM is the type :P. FAIL! y'know, friends always tell me programming could never be fun or funny, but that right theres pretty damn funny to me :P. Thanks for your help man!
FatalCatharsis
14-Nov-11 21:53pm
View
i read this and within two seconds tried it in my code, fully expecting to fix the problem :P. No, it did not occur to me at all that it would not return immediately. However, surprisingly, i got the exact same behavior, tenacious little dialog, and access violation. Which befuddled me more cause, at the very least, that would have made it continue on through and end the dialog, errors or not. so what i just did was put a messagebox to pop up just before the postmessage call, and i found it wasn't even making it that far. When i move the message up, i found that the execution works up until the senddlgitemmessage call to get the ip address. it apparently stops there originally, but doesn't throw up any errors. then when i try and call it again by pressing the button again, that's when i get the error. so what is wrong with the dlg message there?
FatalCatharsis
31-Oct-11 22:44pm
View
woops, sry, totally slipped my mind. there you go :P
FatalCatharsis
31-Oct-11 0:11am
View
ah, yup that was a stupid mistake, worked like a charm. thanks!
FatalCatharsis
16-Oct-11 13:31pm
View
yeh, but if i'm not mistaken, it's impossible to run a 16 bit compiler on a 32 or 64 bit system right? so i pretty much have to find a way to install one of these in dos. i got a copy of turbo c++, but i can't install it on win7x64 because it says it needs a win32 system for installation. and, fun-ily enough, it won't install on dos either :P . so now i guess the question is, is there a way to run a 64 bit program that compiles and links 16 bit executables?
FatalCatharsis
15-Oct-11 15:03pm
View
okay, once i again, i went scouring the internet through very loosely documented information on vga, and i have not been able to find anywhere that tells the memory address of where the fonts are stored at, nor the format that they are stored in. I did however learn that it can hold 8 x 256 character sets, and that, in most 80x25 and 80x50 fonts that they are 8 x 8 pixels. which is cool, but now i need to know where to write it :/ . you wouldn't just happen to have a long lost reference book on this would you?
FatalCatharsis
14-Oct-11 9:49am
View
i apologize, but which are you saying i'm naive over? that i don't know what interupts are (i'll take a stab at it and say, it's an event triggered by certain events from the system, which changes the state of a memory address, which you monitor and handle when it changes? I'll give that webpage you suggest a look over when i have a bit more time), or whether vga does or does not support unicode, because from what i've found, vga can hold only 512 glyphs at max. also, "character anachronism" yields no relevant information on google.
EDIT: After trawling through google, i finally found some information on vga addressing specifications (more sparse then it should be?) and found the vga memory is mapped between 0xA0000 - 0xBFFFF , where the graphical data is between 0xA0000 - 0xAFFFF , monochrome text data is between 0xB0000 - 0xB7FFF, and color text data is between 0xB8000 - 0xBFFFF , does that sound about right to you? so if i write a word of data at 0xB8000, that would display a character on the screen in text only mode? or is there some more to it? ( i don't have dos available to me now, nor do i wish to be directly changing the value of memory locations, without being sure that that where i'm writing isn't vital to the performance of the system :/ )
FatalCatharsis
14-Oct-11 1:23am
View
also, while you're here, i have another dos related question that i was wondering earlier. how do you check if a key has been pressed? not check what string has been entered, but actively, in a sort of message loop like i had earlier, check to see if the state of a key has changed?
FatalCatharsis
14-Oct-11 1:17am
View
i understood it fairly well, until that last paragraph :P, don't have any idea what an interrupt is, or what a handler is for, but that can wait for a different discussion. On to the questions:
1) how does one figure out the address of the text screen buffer, and store it in a pointer, to write to?
2) how do i do the same for the font data, and then what is the format it's in and how do i edit it?
3) just another thought that occurred to me, what you described was a single byte character with color data, does dos support the use of unicode (wide) characters?
FatalCatharsis
13-Oct-11 10:10am
View
whoa whoa, didn't mean, "new syntax to c++", i meant, "new syntax to me" :\ . I'm relatively new to programming, and i've never seen anything like this, i didn't really know what to google to find information on it. Shoot, when i first saw it, i didn't even know that a function was involved with it, i thought it was just trying to dereference a pointer to a pointer in a weird way or something stupid like that. now, after reading this, i google pointer to a function, and it's all over the place :P . So, uh, sorry if this was a stupid question.
FatalCatharsis
11-Oct-11 10:06am
View
oh sorry, i didn't explain fully, i meant something like this :P.
template < class T> base * createT() {return new T;}
vector<base*(*) () > functionStore;
and then you just store the template function with the template argument of a specific derived class like:
functionStore.push_back(&createT<derived1>);
functionStore.push_back(&createT<derived2>);
etc, and then call them at runtime based on some argument that would be the corresponding indice, like if input is 0 then call functionStore[0] (); and create that specific object and store it in a pointer of the base class. polymorphic awesomeness! :P. i was stepping ahead of myself when stating all that :P
FatalCatharsis
11-Oct-11 9:32am
View
and this is just something that i coulda been doing forever ago, pointers to functions?!? god, that seems so incredibly useful. Mkay, i know what i'm gonna be experimenting with for awhile :P. thanks
FatalCatharsis
6-Oct-11 0:40am
View
sadface. i guess i'll just assign id's for them and then make as efficient a checking system as possible :\ Thanks for the information though, it was very enlightening.
FatalCatharsis
1-Oct-11 19:31pm
View
ah, i see what your saying, at first your wording confused me a little, but i understand what you mean after reading the article. just like passing a variable to a function, passing a pointer, just copies the pointer. so to actually manipulate the pointer in a function like you would manipulate the variable in a function, you have to pass it by reference. thanks for the help :P
FatalCatharsis
30-Sep-11 1:46am
View
wow, i have been trying to get this to read correctly for like a week, and it turns out, the read algorithm was working perfectly fine, i just had the multidimensional array all ginked up like you suggested :P, i switched it out for the 1 dimsional array with simple macro idea, and it worked right off the bat! since i've got it this far now, i'm very sure i can get it to read out in a similar fashion. thanks so much for your help!
FatalCatharsis
29-Sep-11 11:36am
View
i'm not currently at a place where i can work on it, but another thought just occured to me. could i make a more normal 2 dimensional array by doing something like this?
pixels = new PIXEL[width];
for (int i = 0; i < width; i++)
pixels[i] = new PIXEL[height]
it might be allocated weird, but i could still access it like i normally like to, pixels[width][height] ya know?
FatalCatharsis
29-Sep-11 11:27am
View
interesting, i see what your saying, i tried to make a 2 dimensional array the normal way before, like
pixel[width-1][height -1]
but it wouldn't work with the dynamic allocation, claiming that the first value had to be a constant or something, i guess i'll just make it one dimensional and make a macro. I'll post back later saying whether it worked or not, thank you so far for you help!
FatalCatharsis
29-Sep-11 9:55am
View
no, i'm not trying to make an array with one single index of height*width pixel values, i'm trying to make a multidimentional array, where each width index has height number of corresponding indices. it will technically have the same number of total indices as an array of height*width, but i feel it is a little more easy to work with, because you can just put in the x and y indices to find the pixel at that spot on the x, y axis. For example instead of having to know that point (0,3) in a 4x4 bitmap is array position 15, (because it reads from the bottom row, left to right), i can just look at pixel[0,3] and there you go. personally i love multidimentional arrays for simplicity, which is what i implemented there. the reason i used width -1 and height -1 because the height and width values are the number of pixels along the width and height, not starting from zero. so say i i have a picture that say it has a width 12 and height of 12. it would start from index value 0 and go to 11 to store all the values for that row. so that's why i'm doing what i'm doing. however, i don't think i'm receiving the values in the correct order, which is why mine program doesn't work right now :(
FatalCatharsis
29-Sep-11 9:34am
View
sorry, i wasn't very clear :P , i'm trying to avoid learning a new third party api just for one simple project. if i could stick with windows or direct x that would be great, but if i have no more options, then i guess i will :P
FatalCatharsis
21-Sep-11 16:57pm
View
wow, your incredibly helpful dude, i'd give you another five stars if i could :P thanks for your help!
FatalCatharsis
21-Sep-11 9:36am
View
ah, intersting, this actually explains alot of other instances where i had similar issues. Are there any problems with including windows multiple times throughout the program?
FatalCatharsis
21-Sep-11 8:46am
View
hmm, yeh, that works, but i'm still curious why i'm able to use the types in my input.h file without needing to include windows. thanks for your help though :P
FatalCatharsis
8-Sep-11 9:34am
View
actually this is interesting, i went through the header, and did find that TCHAR was indeed there and working, and i also found the prototypes for DefSubclassProc and SetWindowSubclass. So does this mean the lib file isn't linking correctly? cause it builds fine without any errors. or is it that the lib file is out of date?
FatalCatharsis
7-Sep-11 13:54pm
View
Edit: uh, i think i accidently deleted that last post.
um, i just started using this compiler and IDE, is there a difference between 1 greater than sign on the end and 2 greater than signs? btw, it doesn't compile with the 2 greater thans, and i already had all that linked and included
FatalCatharsis
7-Sep-11 13:48pm
View
Deleted
um, i just started using this compiler and IDE, is there a difference between 1 greater than sign on the end and 2 greater than signs?
FatalCatharsis
7-Sep-11 13:00pm
View
like i said, installation on these computers isn't an option. when i said MSVC, i did mean MSVC express, but the installation file does not work on usb flash drives. apparently there are some dependencies that it has to install as well or something and doesn't give me the option of changing the installation directory. No, this gui isn't the actual project, but i would like to make the gui for windows, instead of mac. It just seems a bit unfair to me to force us to use Macs for our programming classes when we really have no intention of using it in our career. We do learn programming concepts, but we are also forced to learn the interfaces in macs. which i have no problem with learning, but i'd also like to learn to use WINAPI, and they make that an impossibility. And yes, we have asked, and yes, they said there is no need to learn windows.
FatalCatharsis
5-Sep-11 15:49pm
View
wow, i've spent so much time trying to manipulate edit controls to do what i wanted, I turn around, and theres a control i missed that does exactly what i wanted it to. sigh* once again, thanks Kryukov for putting up with my ignorance once more.
FatalCatharsis
4-Sep-11 3:36am
View
ok, to clear things up, yes, i was aware of strcpy, i just didn't really want to use it because i just try to make everything seem like variables using the assignment operator, call it personal preference :P. but, now i have a whole slew of questions. First, the end of the question in my first comment. second, i don't think i quite understand what the delete operator does. if it deallocates all of the data that the pointer herp originally had allocated to it, then why am i still able to use the pointer and why does it still point to an array of valid characters? third, why is it unsafe to deallocate memory out of the scope it was created?
FatalCatharsis
3-Sep-11 22:52pm
View
interesting! this is alot like something i originally tried to do. i was trying to make it work like a normal reference parameter where the function prototype was:
void pass( TCHAR* & herp);
which wouldn't compile when using TCHAR herp[1024] = ""; . I took your "new" statement there and used it with that prototype that i wrote there, and it worked just fine without all the dereference operators :P. but now i'm curious, because i havn't actually gotten far enough into c++ to learn new and delete, and have no idea what's going on. what is a non-modifiable |value? that is the same thing the compiler told me, and i wish to know what being dynamically allocated memory changes. why can one use the (=) operator and one cannot?
FatalCatharsis
31-Aug-11 22:51pm
View
dangit, i always forget the compiler always reads top to bottom, even when including #includes. i put the #defines before any #includes, and surprise surprise, it makes a difference. *sigh* soon i'm gonna run out of fingers to count stupid mistakes on for this past week. :P
FatalCatharsis
30-Aug-11 11:14am
View
So either way, i'm going to have to use wide character strings in it, regardless of unicode or making up some way of converting it to ANSI by filtering. Which was my question. Actually now that i think about it, no it wasn't. i've been using wide character strings and unicode interchangably, which isn't true, i don't think. Let me reword my question. Is it possible to create a rich edit controls that utilizes ANSI character strings rather the wide-character strings? yeh that sounds better, i'll edit my main question.
FatalCatharsis
29-Aug-11 22:45pm
View
well, i have two comments here. 1) i don't have _UNICODE defined in my project and it won't even give me the option of creating the rich text component, because it does not seem to have an ANSI counterpart and 2) I have already written the rest of my program using ANSI characters. It isn't that i have anything against unicode. shoot, in hindsight, i really wish i had decided to go full unicode, or even better, used the functions and types compatible with both, but hadn't read about it until after i'd already written up a huge project in windows. So my question now is, is there anyway to create a version 4.1 richtext control for ANSI, or will i need to start trawling through and revising my code to be unicode? cause i have seen that there are lower versions that do support ansi, but i figured it would be better to be up to date.
FatalCatharsis
29-Aug-11 22:25pm
View
in the end the exact solution to my problem was to override the WM_CHAR message instead of the WM_KEYDOWN message, and to place the return TRUE; within the VK_RETURN case. Thanks Ivertheengine!
FatalCatharsis
29-Aug-11 22:20pm
View
oh, after reading this again, this would make perfect sense, cause before i was overriding just the keydown, preventing the default message from being passed, hence it not seeing a keydown, hence the beep. then when i override the WM_CHAR instead, it sees the WM_KEYDOWN, as well as the WM_KEYUP. I'll delete my post and accept this solution cause you posted before i did :P
FatalCatharsis
29-Aug-11 18:57pm
View
I'm not at all sure what you meant by this, but when i put that line in my message loop, no text was able to be typed in. and still dinged as well :P.
FatalCatharsis
29-Aug-11 1:26am
View
but it's not a multiline control. it never attempts to display a line outside the dimensions of the control so is there another reason it would beep? been googling furiously.
FatalCatharsis
28-Aug-11 23:25pm
View
yeh, the getwindowtext was commented out while i tried the direct message send, but neither worked. no i didn't mean to use buffer, that was for messagebox specifically, i was just using an LPTSTR cause that's what the function called for, and when i didn't intialize to a value, it caused some errors. i didn't know to try andre's suggestion cause i didn't know a char * could pass as an LPTSTR. Anyway thanks for your assistance.
FatalCatharsis
28-Aug-11 23:17pm
View
wow, that was really stupid of me, worked like a charm. thank you very much.
FatalCatharsis
28-Aug-11 18:43pm
View
for the record, don't even worry about the printout control, all i'm trying to do here is get the text that is entered into the edit control saved in a string.
FatalCatharsis
28-Aug-11 13:42pm
View
Okay, now i get it, yerp another stupid mistake, I'm on a roll today. When the text said it didn't draw the text, i thought it was mentioning it wouldn't draw in those specific cases, where the size of the text is less than the width or when it's a single line. So when the DT_CALCRECT flag is set, all it does when the function is called is return the rectangle with new dimentions to encompass all the text? totally misread that :P .So i just had to call it once with DT_CALCRECT | DT_WORDBREAK and then once more with just DT_WORDBREAK to actually print it out. Worked like a charm! thanks for your help!
FatalCatharsis
28-Aug-11 1:35am
View
um, i don't quite see how that relates to my problem :/ that guy was complaining that the width of the rect changed slightly with DT_CALCRECT even though it wasn't supposed to. i'm having difficulty with it even being drawn. when i set the DT_CALCRECT flag, there is no text in my control when my application is run.
FatalCatharsis
28-Aug-11 0:16am
View
wow, that was entirely not what i meant, i just meant a child window within an application that printed text with a very simple command from the main window procedure, which i later found out was a lot easier than i was about to make it out to be :P. but this little article here has also given me quite a few ideas for some awesome future projects, so i'll accept your solution. Thank you for your input!
FatalCatharsis
27-Aug-11 22:11pm
View
shoot, your totally right. no, what i overlooked was that it was a pointer. I knew that sizeof gives you the size of the variable or object in bytes, and i knew a character was a single byte, so i incorrectly assumed that it would give me the number of chars in the string. stupid mistake :P. thanks for you help!
FatalCatharsis
27-Aug-11 12:54pm
View
fantastic, i had made this huge over complicated program filled with controls that all do random ass sh*t to the other controls as practice, and it went from crappy looking to slightly less disorganized :P. thanks a bunch.
FatalCatharsis
27-Aug-11 12:35pm
View
okay cool. any idea how to enable "the windows theme stuff"?
FatalCatharsis
26-Aug-11 11:20am
View
Bingo, that's exactly what i needed, thank you!
FatalCatharsis
26-Aug-11 11:04am
View
i accepted solution 2, but let it be known, that this solution also put me on the right track, so thanks Emilio.
FatalCatharsis
26-Aug-11 9:33am
View
yes, i understand notifications, but is there any specific notification that will give keypress data within that window? and if not, is sublcassing a possibility, if i were to create a custom message that sends a custom notification with the keypress data, or something similar, or am i way off?
FatalCatharsis
26-Aug-11 9:27am
View
umm, that's a little beyond my winapi knowledge or ability. what is a message hook, and why would i need one? and what is an accelerator table?
FatalCatharsis
26-Aug-11 9:25am
View
nah, sorry, that doesn't help much cause i'm not using mfc.
Show More