15,895,142 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 Ivan Ivanov 83 (Top 43 by date)
Ivan Ivanov 83
26-Nov-19 13:03pm
View
Hi :) thanks for your reply.
The dialog is borderless and the entire client area (which is small) is taken be an editbox. So when the dialog is shown you see only an editbox floating on the screen. The ability to hide it by clicking outside it, is an essential part of the task given to me. So that's not an option, but thanks for your suggestion. :)
Ivan Ivanov 83
3-Feb-19 6:43am
View
Yes editing am335x_evm.sh is absolutely the way to configure BBBs gadgets. It gives you control over almost all peripheries.
Ivan Ivanov 83
1-Oct-17 12:26pm
View
Thanks for your response. You do realize that this thread is 7 years old right? :)
Besides I knew that. That's why I tried to write an extension that would allow me to inline assembly code.
My point was to write a program that looks for assembly code and exports it to .asm files to be compiled by MASM which my program would call automatically. The asm code snippets would be fashioned as functions and calls to those functions would be placed in the C++ code where those asm blocks were originally placed. All that would be handled by my program for seamless compilation.
It's long since I gave up on what I was trying to do. Basically "Sounds good, doesn't work" and it's not worth the time and effort. Dave Kreskowiak was right, I didn't know what I was getting into.
Ivan Ivanov 83
28-Sep-17 8:56am
View
Thank you for your reply :)
"As far as I understand, /sys/class/udc/ is created / filled by the preceding script commands (does not exist before or is empty)"
- That could very well be the case. However the content of that directory is the same before and after the script is ran. Ether the commands in the script don't affect the content or they're not setting everything properly.
I did try to echo the contents of /sys/class/udc/ (namely hdrc.0.auto) into the UDC file but I get the same error every time. (That's after the script is ran)
So, are you familiar with programming BeagleBone, if you don't mind me asking? :)
Ivan Ivanov 83
6-Mar-14 15:17pm
View
You are welcome :)
Ivan Ivanov 83
23-Oct-12 10:34am
View
Sorry for the late replay, I just wanted to thank you for those links. I haven't looked at them in detail but even after the quick look I can say they give exactly the info I needed!
so thanks again :)
Ivan Ivanov 83
23-Oct-12 10:27am
View
Now as you pointed this out I saw that in the old program I have that string does not contain '\008' and '\009' :D
Thank you very much! :)
Ivan Ivanov 83
23-Oct-12 10:22am
View
Strange. In the link you provided points out that the octal notation is represented by '\o...' but if it's for a Single character '\0...' also works as octal representation. And yes in the second example I gave
unsigned char str[] = "\001\002\003\004\005\006\007\008\009\010";
when it reaches \008 it generates a terminating character 0 and then ASCII '8'
so you're right! :)
Ivan Ivanov 83
23-Oct-12 10:12am
View
So I have to use '\x...' to represent those characters as hexedecimal and '\0...' to represent them as OCTAL numbers, that's why 8 and 9 don't work :D
Thanks alot! :)
Ivan Ivanov 83
17-Oct-12 7:01am
View
This is one way to do it. I'll accept this answer even though it's not exactly what I want. I would rather implement my own contol based on this one when I have more time. For now I would have to live with the ugly border of the rich edit control. But it is still a massive help! So thnaks a lot. :)
Ivan Ivanov 83
17-Oct-12 6:55am
View
If you asking did I include/enable the use of 'common control manifest' that allows the program to use the current windows theme for drawing the controls, the answer is Yes. This is why I'm puzzled onto why the rich edit control is the only one that's not affected by the manifest.
Unfortunately I can't agree with your solution to remove the border and custom draw it because (as I just tested it) when you add an OnPaint handler in your CRichEditCtrl derived class all the drawing is handed to it and nothing but the moving caret is shown as you type.
I'm starting to reconsider the ugliness of that border though... :D I'm going to use CRichEditCtrl for my purpose for now. And wrire my own CWnd based control in some other time.
The good news is that thanks to your help now I know that the rich edit 2.0 resource can show the caret on top of all things I draw in the client area of the control, which is not the case with the normal CEdit control which draws everything (text with the default black color) on top of my drawings (the coloredt text). Thah's why when I start writing my custom control I'll use rich edit 2.0 resource in the resource editor as a place holder and caret behaviour handler. ;)
So thanks a lot for your help!!! :)
Ivan Ivanov 83
16-Oct-12 14:03pm
View
Well I did incorporate CRichEditCtrl in my app and when I started my app I saw that the control's border is not like according to WinXP theme which must be a simple brown-gray rectangle around the client area of the control, but has this 3D-like sunken border, that's Win2000 style. When I removed the Border property from the resource the border completely disappeared and the text was no longer verticaly centered, it appeared at the upper left corner of the control. Then I noticed that the rich edit resource look alittle different even in the resource editor, the border is alittle "deeper".. I use VS2003...
I tried all combinations of the Border property and the Client Edge property of the rich edit 2.0 resource without result. There is either sunken 3D border or none.
Ivan Ivanov 83
5-Oct-12 10:50am
View
There is an improvement :) i.e. uFlags = 0;
I removed the TTF_TRACK flag and now the tool tip appears upright as I wanted and as it has to be by default but now it doesn't point the point I provided, instead the stem points the current mouse position. (It doesn't actively track the mouse cursor it just appears at mouse position when the event that brings it occurs and stays there until dismissed)
Ivan Ivanov 83
5-Oct-12 10:36am
View
You might have noticed that one of the stem sides is usually vertical. I tried TTF_ABSOLUTE before, and what happened is that the balloon moved a little bit horizontaly so that it is aligned exactly along the y co-ordinate of the point provided in TTM_TRACKPOSITION message, and that makes the stem a sharper and more tilted triangle since it too wants to point the same point. But the balloon is still below the control.
I removed the sending of TTM_TRACKPOSITION and that made the tool tip to appear at the upper left edge of the desktop :)
Apparently TTM_TRACKPOSITION only controls where the stem points but not the position of the balloon itself. And that as I think is calculated automatically, and if that's the case, and if what I want is the default appearance then something is preventing the balloon to appear above the tool.
Ivan Ivanov 83
5-Oct-12 10:00am
View
OK I included a code sample :) and sorry I didn't initially do it.
As you can see I never used the TTF_CENTERTIP flag, but either with or without it the balloon is still below the point (which in the case is the middle of the control) Something else is preventing it from showing as it should. I estabilished that the rectangle of the transparent parent window don't affect the position of the tool tip
Ivan Ivanov 83
5-Oct-12 9:19am
View
Deleted
Thanks anyway :)
Ivan Ivanov 83
5-Oct-12 9:15am
View
I haven't read this exact article but I've already tried those flags and I just tried them again but they don't do the trick. For example the TTF_CENTERTIP centers the stem horizontaly but the balloon is still below the point. Maybe I should provide more information on what exactly is the case. Strangely it says that the appearance I want is the default, so apparently I'm not doing something right.
For example if the balloon apears above the point I give, it will slightly exceed the upper edge of the program but since the program window is close to the center of the desktop that shouldn't be a problem, sould it?
Thanks anyway :)I'll read this article again carefully.
Ivan Ivanov 83
5-Oct-12 8:53am
View
Sory maybe I wasn't clear enough. The article "Balloon Tips Galore" isn't my own. I just included it for the picture ;) so people can see what I mean.
Ivan Ivanov 83
24-Oct-11 15:08pm
View
Yes there are such utilities. In my case that is ASUS PC Probe. I used Depends.exe to find what kind of DLLs it loads but found nothing related to hardware, IO or sensors. It appears that the EXE iteslf does this job. I also tried SpeedFan and Everest... All the same, they load pretty mutch the same bunch of DLLs. I think thats made on purpose, so guys like me couldn't just take the related DLL and use it in their porgrams ... He he he :)
And about contacting ASUS, That's a very good idea. I actually had success doing this with ATi back when I was writing GPU load and GPU colocks tab so I'm going to mail them (ASUS) tomorrow 'cause as I can see now there isn't any section in their site about this subject...
Thanks again :)
Ivan Ivanov 83
24-Oct-11 14:30pm
View
Hi Richard
Thanks to your post I was able to find this topic:
http://bytes.com/topic/net/answers/606945-get-cpu-fan-speed-cpu-temp
Which explains in detail my porblem and why WMI can't be used at this point.
In essence the problem with WMI is that it has all the tools for this job like: Objects/Clsses/APIs but they are all kind of abstract. That means that they exist as names, as structures but they are not attached to an actual physical device specific implementation that does the job! Only few vendors have provided WMI compliant drivers for the high-end workstations/servers so WMI can be useful only in those limited cases. This is why, in many computers when you try to use WMI to get temperatures the WMI functions return no results... (they don't issue an error, but just no result - 0)
Also I used "wbemtest" WMI testing tool to check if my PC is "lucky" to be in this group, and I confirmed it is not :D
It appears that for now getting eyeball to eyeball with drivers, buses and controllers is the only (if painful) way...
So WMI is no go, but anyway your post was very useful for me so thanks a lot again :)
Ivan Ivanov 83
27-Aug-11 7:31am
View
I appreciate your answer but I have already tasted the factor (360 / 44100) and it produces exactly 1 Hz frequency.
with (1 / 44100) factor it will produce just higher frequency but those turnovers will remain ;)
Thanks a lot anyway :)
Ivan Ivanov 83
27-Aug-11 7:22am
View
You are a Genius! :)
I just tested it, and it works perfectly!
Well, I missed to mention that my math skill isn't gery good ;). I'll need some time to process onto how does it work so well, but the fact is a fact - it works!
I was so puzzled by this glitch that I thought that nobody could help me :D thank god I was so wrong :D
It turns out that generating descending patterns IS possible after all :D :D
Ivan Ivanov 83
5-Jul-11 14:04pm
View
Thank you very much! I finally know what the problem was. I indeed like to rearrange my code and usually do remove the generated comments. Interestingly I do that all the time and yet I get the bug only occasionally... Anyway your answer makes perfect sense so that must be it. :)
Now the second point you made is important too. I do know how to do everything without the wizards and I do understand the code ;), my point was (and is) that if those wizars are there they sould work. It's not a problem to add a single class or an event handler, or a control variable, but if you have to add dozens of them (and more) it slows down the work, and it shifts your atention from the real prblems... (And besides once you get used to the wizards it's really annoying without them :D)
Thanks a lot again :)
Ivan Ivanov 83
30-Dec-10 7:52am
View
I greatly appreciate your answer and I really wish it would work, but it doesn't unfortunately.
You see a definition of a data/code segment isn't relative to the context in which the very definition is placed in. It doesn't matter wheter you define it inside of a fuction or in the open area (for instance in the beginning of a file). It'll place the code in a speciffic location in the OBJ (and later in the executable) not right in the place of data/code_seg definition ;).
Thanks a lot anyway! :)
OK I'm almost there, the solution for identifying a block within a larger blck is already found! Now the soultion for inline function. An identifying code that will be placed wherever the function is inlined. - That's a hard stuff as it seems! :)
Ivan Ivanov 83
27-Dec-10 10:35am
View
Yes! It works for the code block (in the middle of a larger function) but not for the inline function.. good idea BTW :)
Ivan Ivanov 83
19-Nov-10 9:32am
View
Deleted
Hi. I respect your opinion but I don't think the task is that complicated. See in fact what I'm going to write is neither C++ compiler nor ASM compiler, it just dispatches the different kinds of code to the respective modules that can compile them, and then assembles the pieces.
Actually I just made a test. I've made a simple console "Hello, world" app and named it cl.exe. Then I've put it into the bin directory of the VS and started a build. And then I saw my "Hello, world" in the Output window of the IDE! Ha! :D
After that I made my cl.exe to spawn the original one renamed to cl64.exe... Guess what everything gone smooth and slick :) I saw the "Hello, world" almost after each CPP file. (obviously the original cl64.exe sometimes overrides what my exe writes in the stream ;) but that's not a problem)
By the way, I've figured some very easy way to find out the things I've asked about. Well there are few more things to consider but I already have ideas... ;)
Ivan Ivanov 83
3-Nov-10 16:56pm
View
Thanks I'll cosider this :)
Ivan Ivanov 83
3-Nov-10 13:12pm
View
Superb :) Thank you very much! I'll consider both of those solutions.
Ivan Ivanov 83
3-Nov-10 11:17am
View
"A reboot is still a shutdown, if you think of it. Except that the machine is instantly turned on after shutting down" That is absolutely true for laptops but desktops are different sotry ;) none of the PC components is powered off by the issues reset signal. but that's an interesting point :)if I have to make difference between laptops and desktops I better leave it like it is now (the functionality is implemented only ti resets after restart) maybe I really sholdn't make it so complicated. :) Otherwise I had that idea to capture a handle of the very window that holds the <stand by=""><shut down=""><restart> buttons and get the return code... Do you think that could work out? :)
Ivan Ivanov 83
3-Nov-10 10:39am
View
Well I did a bit silly :). I wanted to keep the question short but I instead made it too short! :D What I'll write now had to be in the question itself.
In my program I need to show for how long the PC is running since it was turned on. But not like what you see in the LAN status window. If I restart the time interval keeping variable shown by the program should be saved and shown after reentry in Win (Because the PC wasn't physically turned of). And if I press the Shut Down button that shouldn't happen. You see I need two different behaviours on pressing restart and shut down so my question was really missleading, sorry.
I actually started writing this but I've deleted it 'cause I thought it was clear enough. (obviously I was wrong)
Ivan Ivanov 83
3-Nov-10 9:03am
View
By "the icon did not display in the dialogbox" I'm guesing it didn't show in the upper left corner in the dialog frame just before the dialog's caption? If that's the case you can see hoe it's done in the default MFC dialog applications. It's like this:
HICON m_hIcon; // In the dialog class definition (the dialog that's in the DLL).
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); //Inside the dialog's constructor.
And finally.. This code is inside the OnInitDialog
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
If you've created the DLL as a MFC DLL the 'theApp' should be available and hence you shouln't have any problem obtaining the hInstance of the DLL.
If you didn't create the project as a MFC DLL I advise you do.
I hope that helps :)
Ivan Ivanov 83
30-Sep-10 5:23am
View
Hi E.F. Nijboer
You are right the the alpha version of OHM shows 4 GPUs but I have beta version the shows only 2.
I can see you have knowledge on this and it is logical that for each one of the monitor outputs there should be a GPU. But since I have only one monitor are all the GPUs in use? Also GPU-Z shows 2 GPUs, how do they choose which two to actually show and which two not to show in the program? (that's related to OHM too).
I guess at least two of them will never be active untill a monitor is attached to them. How do you think? :)
also the Device Manager also shows 2 display adapters.
Ivan Ivanov 83
30-Sep-10 5:10am
View
Yeah Hi :)
The Open Hardware Monitor was a good example. It answered a lot of my questions and showed me very important tips on how to do the job, but I didn't use directly its code, simply because it's managed code, it's written in C#. I write my program using C++/MFC. Also in OHM the actual functionality is encapsulated in a DLL which isn't part of the open code (and supposedly written in C# too). That's not a problem but I wanted more direct approach. After all (as I found out lated) that DLL uses the only possble technique to do the job, namely: to use ATi ADL (AMD Display Library) SDK for the ATI products and nVIDIA NVAPI SDK for nVIDIA products.
An app should incorporate both methods and has to be able to identify the installed card's vendor and dynamically switch to the respective one.
And this is what I'm doing now. I'm potting in use ATi ADL. :)
You've wanted me to write an archicle? OK I promise you this :) after I'm done with the task I'll post one and I'll notify you so you can see it ;)
Ivan Ivanov 83
15-Sep-10 9:16am
View
The VS got seriously buged!!!
Now I found out that it won't create class for my new dialog resource. It doesn't create the h/cpp files, it does nothing.
If you have a solution please write soon! :)
Ivan Ivanov 83
14-Sep-10 15:03pm
View
Yes, exactly! :)
Ivan Ivanov 83
9-Sep-10 7:16am
View
Thanks a lot :) I'll remember that. But it seems I've overestimated the problem. ;)
The problem was that I was updating the variables that hold the position and the width and height using 'x' and 'y' in OnMove and 'cx' and 'cy' in OnSize which are client coords/dimensions. I simply changed that to
CRect AppRect;
GetWindowRect(&AppRect);
m_nXPos = AppRect.left;
m_nYPos = AppRect.top;
in OnMove
AND.
CRect AppRect;
GetWindowRect(&AppRect);
m_uiWidth = AppRect.Width();
m_uiHeight = AppRect.Height();
In OnSize
So at the time I close the app those vars always hold the correct coords/dims :)
Thanks again I couldn't do it without your hints/tips :)
Ivan Ivanov 83
8-Sep-10 7:27am
View
OK I have some improvement! Now the dialog moves and resizes almost as it should. the problem is that I resize the window using the co-ordinades and size of the client area and that makes it shrink ;). This is something I can handle. But of course if you have some ideas you can share them. :)
Ivan Ivanov 83
8-Sep-10 7:07am
View
I see your point. You're most probably right. After I moved the resizing code to OnShowWindow things got a little better. now my program moves relatively close to the position it sould be (few tens of pixels away in both x and y directions but certainly that's not the default position) and it's at its minimal size instead of the required one.
I wonder sould I do something with OnGetMinMaxInfo?
What do you think?
Ivan Ivanov 83
25-Aug-10 4:11am
View
Ha! interesting idea. :) But I already solved my problem. It's called "Open Hardware Monitor" it's open source so I can look directly how things are done. And from what I've seen so far it seems that there are only two logics, one for ATi and one for nVidia. I think there isn't different logic for every vendor, unless if the different logics are resolved in a lower level that I haven't seen yet.
Anyway thanks a lot for your replay! :)
P.S. I might post my results after I'm done! ;)
Ivan Ivanov 83
23-Aug-10 5:41am
View
I greatly appreciate your replay! :) Knowing that this task may prove extremely hard. I'm not afraid to incorporate different logic for different vendors if I have the knowledge of the different logics. ;) And I even may purchase the API if I see it affordable for me, and more imprtant
if that's what GPU-Z uses!
So I'll be happy if you know how GPU-Z does this job! I don't mean in details, overall, do they use this ZoomAPI or not. :)
Thanks again! :)
Ivan Ivanov 83
2-Aug-10 8:27am
View
Well yes there are few things: :)
- First. This code isn't supposed to be in the constructor of CMainFrame, it's for OnCreate, you should put it there. At the point the constructor of the main frame is called the main frame is NOT a window yet!
- Second. if you want a menu in a MFC application you need to create a menu resource! simply calling CreateMenu won't do the job at all. ;)
- Third. You need to specify where do you want the menu to appear, in terms of coordinates. ;)
- Fourth. You need to specify the window which the menu belongs to, the menu has to have a parent window! This is very important. ;)
The code should look like this
m_wndMainMenu.LoadMenu(IDR_MAINMENU);
m_wndFileMenu.LoadMenu(IDR_FILEMENU);
....
Now as I see your code sample... I think you want to create THE main menu and THE file menu, why?!!!
They are created automatically with the solution itself if you've created MFC SDI project.
You are not supposed to create them yourself!
What version of visual studio do you use?
Ivan Ivanov 83
2-Aug-10 4:32am
View
No result. Besides WS_BORDER isn't an extended style, it's basic style, but anyway thanks for the try :)
Ivan Ivanov 83
13-Jul-10 11:05am
View
Thank you veery much :) That's indeed exactly what I needed!
As you mentioned "variable number of arguments, a format string to parse, and a lot of data-types" it puzzles me how sprintf and others like it tell the difference between float and double? I mean we type "%f" in both cases but when it's double two dwords are pushed in the stack, so how can that be distinguished from within the function? I'm just curious :)
Show More