Fantastic video. So helpful to have this explained clearly by someone, instead of having to figure everything out for myself from the documentation!
@geofflord47972 жыл бұрын
Hi these are amazing tutorials, very clear throughout the whole series of videos: For anyone using Visual Studio 2022: the Lib file name is "ComDlg32.Lib" Just for good measure i added the line of code at the top just under the header files: #pragma comment(lib, "ComDlg32.Lib") To add to the Libraries on VS right click the Solution Name-> Properties then click Linker->Input and in the Additional Dependencies->edit and add the Filename ComDlg32.Lib and click ok. Then Click apply and Ok and this should run. The Lib Files on my system are located by default on VS install: C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\um\x64 I hope this helps someone.
@GrandNecro4 жыл бұрын
for anyone having trouble with the GetOpenFileName() function. you need to add include the #include library and add -lcomdlg32 when compiling the program: gcc .\test_gui.c -lcomdlg32
@baltazarus33075 жыл бұрын
Hy people if char *data = new char[size+1] doesn't work, try to put *(char *)malloc(size+1)* instead of *new char[size+1]* but you've to include , library (for C++ files) or , for C and of course after put *free(data)* to deallocate "data" memory. It worked for me. edit: For C++ file, feel free to use char* data = reinterpret_cast(malloc(size+1))
@iansapelino64075 жыл бұрын
Okay.
@iansapelino64075 жыл бұрын
But how do you interpret it in c? for I know that this kind of argument is in C++?
@andreimiga81014 жыл бұрын
Some clarifications: 1. In C++, you don't need to include any header files for the allocation. Also, the deallocation is done with "delete data;" 2. In C, you need to #include . To allocate you need to do "data=malloc(size+1);" (no need to cast the result unless you want the code to also compile in C++), and to deallocate you need to "free(data);" EDIT: I have noticed the purpose of the comment just afterwards. Not a single time have I come across a C++ compiler which doesn't have a working 'new' operator, since memory management is one of the most basic operations in C++.
@Lugmillord6 жыл бұрын
Phew, I had real issues finding the libcomdlg32.a since the search function didn't help at all. I forgot, that MinGW is inside the Code::Blocks-Folder, in my case it was in C:\Program Files (x86)\CodeBlocks\MinGW\lib (Windows 10). Maybe that helps others failing at finding it.
@Keys_99142 жыл бұрын
finally a channel I understand ...
@stefanmoser43487 жыл бұрын
hi Ed :-) your tutorials are becoming always better. I know, that c++ is very tricky, but when you want to do graphics and program games, you'll have to use it. I'm already looking forward to the next part & thank you for showing ;-)
@ThePentamollisProject7 жыл бұрын
glad to have your feedback. I'll try to upload the next part ASAP.
@ВладСергачёв-и2ш4 жыл бұрын
Hello guy! I want to thank you for this tutorial series. It really helped me out because I tried to learn winapi with other tutorials but It wasn't succesfully.. So now at least I can to write some primitive program) Thank you very much!
@wanderingpalace3 жыл бұрын
just read the winapi programming by charles petzold i found it really useful indepth and lengthy tho
@aibou23995 жыл бұрын
Great vid. For anyone compiling from mingw console line, i used "g++ Main.cpp -o Main.exe -lcomdlg32"
@venkateshnagaraju8885 жыл бұрын
can some one help me to implement the drag and drop event using window 32 API in c++
@veggieboy12 жыл бұрын
Can you also allow the user to select a folder (directory) in this fashion?
@carlos1442 жыл бұрын
a value of type "char *" cannot be assigned to an entity of type "LPWSTR"
@therandomsomeone.2 жыл бұрын
that's because char* is not lpwstr and i do not think you can cast a char* to lpwstr
@TechWithSwag6 жыл бұрын
error C2664: 'void display_file(char *)' : cannot convert argument 1 from 'LPWSTR' to 'char*'
@mistakenmeme5 жыл бұрын
Replace your parameter with ‘wchar_t*’ and see if that works.
@MisterTyken5 жыл бұрын
fopen(path, "rb"); doesnt work for me. the error that pops up says --- Severity Code Description Project File Line Suppression State Error C4996 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. WindowFile c:\users\faceo\source epos\windowfile\windowfile\main.cpp 50
@andreimiga81014 жыл бұрын
Add the following line at the very top of your source file: #pragma warning(disable:4996) This is just some microsoft bullshit, don't worry about it.
@disekjoumoer2 жыл бұрын
@@andreimiga8101 It's not microsoft bullshit. use fopen_s instead.
@Seventro73 жыл бұрын
which software you using ?? or you done everything by handcode ??
@mmafandude1338 Жыл бұрын
Why are my characters in Chinese, Korean?? the window that shows the file is frozen as well
@peterSobieraj Жыл бұрын
Shoudn't nMaxFile be 99 ? Since file_name have 100 elements, including terminating 0.
@pierreforget33572 жыл бұрын
Works fine, except for one thing. Once the file has been inserted in the main box, it stays white characters on white background until I select the text. Once selected, then it's black on white characters. Anybody has an idea?
@cmacc64776 жыл бұрын
If you use "new" you have to use "delete" too. Or malloc/free.
@scramjet46104 жыл бұрын
Not in the case of a simple application like this because when the application ends, the allocated memory is returned to the system. You need to delete allocated memory only when function runs a long time with repeated large memory allocations.
@TechWithSwag6 жыл бұрын
I am facing an issue : Please help me out; error C2440: '=' : cannot convert from 'const char [51]' to 'LPCWSTR'
@khairulalom14886 жыл бұрын
use Function_Name without appending W
@readmoreon23902 жыл бұрын
or use L" "; since unicode stuff
@aliasdude32884 жыл бұрын
I'm having an issue getting the libcomdlg32.a to be used on dev-c++
@rd46034 жыл бұрын
How can I select more file types, for example "JPG files\0*.jpg,*.jpeg\0" because this doesn't work? EDIT: I figured it out You can search for multiple data types in the explorer like "*.jpg OR *.jpeg". You have to be careful because the OR is case sensitive. It doesn't work in the program. Here you have to write "*.jpg;*.jpeg"
@grizzly91805 жыл бұрын
when I build this as GUI Application, it freezes the shit out my i7 computer and the main window won't show up.
@jericogaming19525 жыл бұрын
you need to configure your projects settings first in order to use WinMain, just check the error if one exists,also try to allocate memory for wnd class: memset(&wc,0,sizeof(wc));
@ubaidullah51273 жыл бұрын
How do I assign tasks to my "Enter Key" ??
@glebmatveev29147 жыл бұрын
Thank for your video. It's help me with my course project. I saw everything i needed. Thank you so much!
@bamster646 жыл бұрын
Please keep making these tutorials
@ThePentamollisProject6 жыл бұрын
I've been inactive in this series for a long time cuz I've been working on the opengl ,c++ tutorials for a while, but I've planned the next video I upload will be an addition to this series. stay tuned, it'll be up within a week or two.
@bamster646 жыл бұрын
Thanks, I will be sure to check your other videos too ^^
@raveltammeleht627816 күн бұрын
That is strange, why char works on your machine?? I had to modify the code to get it to working. Firstly I had to define the file_name as TCHAR file_name[256] = TEXT(""); and secondly, the lpstrFilter must be defined as TEXT("\0*.wav\0") and then it starts to work. I find it interesting that char works on your case...
@raveltammeleht627816 күн бұрын
Oh .. I suspect you were using OPENFILENAMEA instead ... that explains, because now I am able to use chars! So it turns out, that you have to chose between UNICODE or ANSI characters in the editor. Afterwards you Should decide wether to use OPENFILENAMEA(ansi) or OPENFILENAMEW (for unicode, best compatibility as I understood). Either way thanks. Informative tutorial.
@nutcrackzengine12327 жыл бұрын
Hi could you please make a tutorial on how to create a list box and adding items to it and select them (for example using a message box to show which item has been selected)
@Lee-jh3rv7 жыл бұрын
Hi, thanks for the tutorial. I have some problem with generating "open file" button. After I did everything you showed, the place that supposes to be a button is just grey...I have the same problem with Image, too. Do you have any idea about that?
@ThePentamollisProject7 жыл бұрын
please copy paste your source code here in a reply, or mail it to me at edratulthakur0@gmail.com. I'll look into it.
@sayedkazimi62143 жыл бұрын
Hi man, I am following your tutorial. I followed your code but I got multiple errors and the big one is: A head has been corrupted. the debugger shows it "DispatchMessage(&msg);" I searched a lot on Ggle but could not find any solution. Thanks
@Fleekz_7 ай бұрын
I have the same exact issue right now. Have you fixed it? If yes please tell me how.
@aerahtv00006 жыл бұрын
what if i use Visual studio , how this library libcomdlg32.a will be named and where to find it?
@disekjoumoer2 жыл бұрын
If you have included windows.h, you don't need to include anything else.
@akarshitbatra17542 жыл бұрын
@@disekjoumoer but he have to give -llibcomdlg32.a while compiling after the file name .
@game-br5ow7 жыл бұрын
My app crashed. The reason is that the char needs to be new char[_size+1] and not char(_size+1). But I don't understand what exactly was allocated using the new char(_size+1).
@ThePentamollisProject7 жыл бұрын
thanks a lot for reporting this error. I'm gonna remake the tutorial replace it ASAP.
@gladeare5 жыл бұрын
@@ThePentamollisProject Are you still planning on doing this? Especially with all the _s functions and other functions being split to _w functions, this would be really helpful. :)
@disekjoumoer2 жыл бұрын
@@ThePentamollisProject Except you never did. But you do still delete comments.
@Gizego7 жыл бұрын
Why are the videos at 480p?
@ThePentamollisProject7 жыл бұрын
i only record a part of my screen .. and thats why i get a lower resolution. Although, i'm soon going to upgrade my setup. The quality will get better. :-)
@Gizego7 жыл бұрын
Is using 2 monitors good for a programmer? I am coding a lot in c#.
@stefanmoser43487 жыл бұрын
@Ed, the resolution is totally ok. a good idea is, that you are coding black on white. so the text is better readable than on a dark background
@stefanmoser43487 жыл бұрын
hi @gizego. more than 1 monitor is good for every kind of work on pc's. also in work I use 2 Monitors. when you are writing programs, you can install the IDE on one monitor and on the second screen you can look up things in the Internet, or watch viedeos, for example :-)
@Gizego7 жыл бұрын
My idea was keep the program running in the 2nd screen
@rashaadahmad25174 жыл бұрын
it is comdlg32.lib in digital mars c compiler
@623-x7b5 жыл бұрын
link against -lcomdlg32 for those not uses visual studio. Type g++ myfile.cpp -lcomdlg32
@mnada727 жыл бұрын
Hi, are you going to add more topics to this tutorial ? I really enjoyed it, but please consider your speed in the next videos :) Many thanks
@MasterMindmars2 жыл бұрын
Very good
@FLStudioTutorialsMyanmar7 жыл бұрын
Thank You Very Much For All Tutorial.I' m From MYANMAR .What is Your Country?
@ThePentamollisProject7 жыл бұрын
glad to have your feedback. I'm from India. ...north India