- Strength to Increase Rep
- +6
- Strength to Decrease Rep
- -1
- Upvotes Received
- 3
- Posts with Upvotes
- 3
- Upvoting Members
- 3
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
- Interests
- Everything that is related to this.
- PC Specs
- Dual booted Windows and Ubuntu Karmic Koala. Have experience of both *nix and windows. I prefer programming…
68 Posted Topics
Re: You need an open project, to start a new project go either to File>New>Project, or press Ctrl+Shit+N. Preferably choose the Empty project template. Then, right click on the Source Files folder to the left and choose Add>New Item... Then you get a dialog where you can choose the name of … | |
Hello, I have been struggling with this for hours now. Is there any way to completely remove the icon that is displayed in the upper left corner of a window in WPF, without setting the window style to ToolWindow? I have tried loading user32 and setting various WinAPI-styles with no … | |
Re: Do you want only client scripts to execute upon button click? In that case, I suggest using an ordinary input-html tag. [code=html] <input type="button" value="Button Text" id="yourButtonId" /> [/code] And attach a click event in client code. | |
Re: That is very common when programming hardware in C and the addresses are known. They could be static I/O or similar. address_1 is 0x00AA8B20, (float*) address_1 would interpret the address as a pointer to a float and * (float*) address_1 then means the variable stored at that address. | |
Hi. I have a richedit control and when dropping text from another control I would like to change the format of that text. I wonder which messages I should trap or how to do this in plain Winapi. (I have already subclassed the pasting message) Thank you. | |
Re: I have no problem trying sizeof(test)/sizeof(int) in main but in the template function it outputs 1. | |
Re: Have you done anything so far? Any ideas on how to do it? | |
| |
Re: I don't know much mfc but with winapi you could do it with SetWindowPos() as above, or set the window extended style to WS_EX_TOPMOST if I remember correctly. Hope it helps. As far as I know winapi functions can be called from an mfc application. | |
Re: And when transforming the string you don't have to do it manually, you can do it in a for-loop instead and just copy every element in the array with toupper(). [CODE]for(unsigned i=0; i<strlen(yourString); i++){ yourString[i] = toupper( yourString[i] ); } [/CODE] This will also work for any length string, but … | |
Re: Well, I think that Microsoft Embedded Visual C++ works on XP. If you are ok on writing in plain C you could check out Pelles C IDE. I don't think that NetBeans offers any WM5 support, you'd have to learn Java then. | |
Re: You shouldn't have several CALLBACKs for the same window. Maybe write a function that takes care of this specific case? | |
Re: Have you written anything so far, if yes may I see? What you need to do is parse the text file. If you can expect the file to always have that structure it should be an easy task. Using ifstream and ofstream you'd: - Skip the first to lines - … | |
Re: And if that isn't enough you could google for x86 documentation. Should be plenty. | |
Re: I see you are drawing the bitmaps directly. Then you'll have to get the arrow keystrokes from the main window and then determine which bitmap is to be moved. Perhaps you could get mouse pointer coordinates at a WM_LBUTTONDOWN message and then decide which bitmap is to get attention. | |
Re: ULONG fib(ULONG n) is a function and what is passed to that function is in main known as "position". The "\n" on line 15 is simply a newline character, try removing the whole cout statement to see the difference. The typedef on line 7 is just something telling the compiler … | |
Re: [CODE]new[/CODE] allocates a new place in memory at which the pointer then points. [CODE]delete[/CODE] frees the memory at which the pointer points. Hence, not deleting any pointer that has been given a part of the heap, will cause a memory leak. Maybe a very small one, but it does cause … | |
Re: It would be easier to go through your code if it had CODE-tags. Anyway, I couldn't see what the problem was unless you are trying to compile the :S - smiles. So I tried changing the smiles into just [ICODE]:S[/ICODE] and it compiled fine. It could be that some file … | |
I developing a small program that I want working as a widget, and would like to display it only when no window has focus - or when the desktop window has focus. My best chance now is finding whether GetFocus() returns NULL but this is not working as suspected. I've … | |
Re: The ifstream operator takes care of anything considering variable types. [CODE]myfile >> lastN >> firstN >> amount;[/CODE] | |
Re: You are incrementing pointers that are not initialized. | |
Re: WinAPI isn't that hard, it just looks that way at first glance. And you don't have to use any C-specific calls. | |
Re: Try removing the ampersands on line 13. | |
Re: I assume that you realized that the zeros printed out are the same zeros that you stuff the array with in your first for-loop. This is because you set the dimension to 3. That creates a matrix sized 3*3, giving you 9 stored values. As you can see your output … | |
Re: Haha. Where is the textbox? Is it a listbox, combobox or an edit control? Using wxwidgets, mfc, atl, winapi or what? The guessing game continues.. | |
Hello. I am quite keen with the win32 api but am tired of the standard windows visual styles (XP/Vista/7) and am wondering how to create my own. Have googled but not found any information, just point me in the right direction. Thank you very much. | |
Re: You are using atoi() wrong. It returns an integer. [CODE]char *str = "1"; int _one = atoi(str);[/CODE] | |
Re: [CODE]void mainmenu() { //If you want to exit prematurely, use return; if(true) return; } void etc() { } int main() { //When calling a function, do as such: mainmenu(); etc(); return 0; }[/CODE] | |
Re: I have tried some methods of reading single values into a bool array, but haven't got it working. I have however done a test with reading in single chars and then bitwise AND-ing them to discover which bits are set. Here's a simple example of how I did it. [CODE]#include … | |
Re: I understood that you also wanted to know how to limit the input to a certain amount of characters. You should use [CODE]fgets(char* target, MAX_CHARS, stdin);[/CODE] to do it. | |
Re: I think you are initializing the arrays as pointers. Do it as: [CODE]unsigned char byte0[2]; strcpy(byte0, "0x");[/CODE] instead. But this does not consider the nullterminator, so the array should have size 3. [CODE]unsigned char byte0[3];[/CODE] Also, I don't know if strcat() takes unsigned characters. Try with just char, or by … | |
Re: I don't fully understand. Are you looking for examples on multithreaded applications? | |
Re: You'll need a wrapper. Check these links. [url]http://www.newty.de/fpt/callback.html[/url] [url]http://www.codeguru.com/Cpp/Cpp/cpp_mfc/callbacks/article.php/c4123/[/url] | |
Re: I haven't read through your whole post, but when deleting strings: [CODE]string *inString = new string; delete inString;[/CODE] | |
Re: Consider only this: [CODE]scanf("%s", &s[0]); printf("%s", s[0]);[/CODE] What happens? | |
I have three files: main.cpp [CODE]#include "CMain.h" int WINAPI WinMain(HINSTANCE hIn...) { return 0; }[/CODE] CMain.cpp [CODE]#include "CMain.h" using namespace Program; LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch(msg) { case WM_DESTROY: PostQuitMessage(0); break; default: return DefWindowProc(hwnd, msg, wParam, lParam); } return 0; } CMain::CMain(void) { … | |
Re: I don't fully understand what you want to do. Do you want to change a certain text when mouseover a specific image? Or do you want the image to change? [CODE]<img onmouseover="this.src='source'" onmouseout="this.source='anothersource'" />[/CODE] Or if you just want a text to show when mouseover an image, I belive Zero13's … | |
Re: The w3schools tutorials are great. [url]http://www.w3schools.com/css/[/url] Have fun! | |
Hello there. I don't know if this should actually be posted in any of the C/C++ forums, but it is mainly an Assembly question so I take my chances here. In C/C++ it is possible to declare local variables as: [CODE=C]if(statement){ int var; // Use of the variables }else{ // … | |
Re: I don't really understand what the game does. Maybe you could have the if-statements in a loop so that one can keep moving? | |
Re: Do you know how to make flow charts? Have you made any progress on the exercise? | |
Re: Does this occure only when the program is launched at startup? Under what operating system? I had a similar problem under windows and figured it was because the program wasn't given permission to save files. | |
Re: What do you know so far, how much programming have you done? I don't know much about graphics under *nix but using windows there is windows.h that is plain C. But programming GUIs differ much from console applications. I could provide you with a couple of very good tutorials. | |
Re: [QUOTE=ckjie;1156985]Hi all, I'm new to this community. I am doing a project that I'd have to write a program to connect 2(at least) PCs together. each PC works as a server and at the same time as a client, which each of them can download the file which is shared … | |
Re: Yes that is weird, I have never encountered such problem. Are you sure you are using the RECT right (ie . instead of ->)? And besides, why do you want to pass it by value instead of reference? | |
Re: You'll probably encounter EOF (End of File) when using file streams though. It is then as simple as a bool stream.eof() to use. |
The End.