|
Do you have an-email address I can e-mail you offline
Thanks
|
|
|
|
|
It's on my bio
In vino veritas
|
|
|
|
|
thanks
The Visual Studio Thread windows I know has the ability to freeze threads
Regardless I'll download the extension
Let me explain the nature of the problem
I'll writing an a debugger for another platform (working with an emulator )
I am modifying the emulated "C" code
the way interrupt the "debugged" code/program
is by overlaying the instruction which gives me control and shows the user the code
I quickly put back the over laid instruction
this works well when the user is debugging a Single Threaded program
however in a multiThreaded programs other threads or tasks executing the same code
get a operation exception before I put the code back
The way I coded this was as soon as I overlay the instruction I do a
ResetEvent which cause a Event to be non-signaled and stop the other threads/tasks
from executing this code until I have a chance
to put back the instruction I then do a SetEvent
to let the other threads/tasks execute the code
Something is obviously not working out right in this timing
In Visual Studio I can observe how QUICKLY The Windows dispatcher
Switches from thread to thread
Thanks for your help
|
|
|
|
|
If you get this then you need to use thread synchronisaiton so that WHATEVER happens, and it will, one day, your threads process data and events in a coordinated fashion.
|
|
|
|
|
(I still must be in the spirit of Christmas)
Q: How do I add gallery buttons items to a gallery button with the resource editor ?
I created a default application with the ribbon UI.
In the resource editor, I added a "Gallery Button" and into that I added a few button items in the collection
I manually added event handlers for each item.
When I start the application, the gallery button just looks like a button and when I click on it, no "menu" is displayed.
I looked at the samples projects ( RibbonGadgets and RibbonMDI) and they just code the ribbon manually.
Q: Am I missing something? The properties for the gallery button does not show anything useful.
Q: Should I just give up on the ribbon designer and code everything manually ?
Thanks.
Max.
I'd rather be phishing!
|
|
|
|
|
Did you ever find an answer here? I have the same issue.
|
|
|
|
|
A semi-popular IDE compiles my C++ code without declaring function prototype.
Did I missed the newsflash or just an compiler option?
Seems odd.
|
|
|
|
|
You only need prototypes for forward declarations. And IDEs do not do the compiling, that's the compiler's job.
|
|
|
|
|
True, but I have been using IDE whose authors are very fond of their "beginners feature " which actually builds prototypes "for you". So they claim.
I am now test driving another IDE, still based on GCC and the first test function I used compiled without prototype, that is why I made this post.
Next function failed without prototype, so I am not sure what is going on.
So what is the difference between prototype and forward declaration?
Or is there a difference?
|
|
|
|
|
When the compiler comes across a function call it checks its tables for a declared prototype. If it cannot find one then it will infer a definition from the parameters of the function call. When it then finds the actual function it will check that the definition matches the stored declaration. If it does, then all well and good. If it does not then it will throw out an error message.
As to your last question, a prototype is a forward declaration. It just tells the compiler the type of the parameters and return value of the function, so it can check on any calls made to the function before it is found in the source. The same applies to external functions whose prototypes are in .h files.
|
|
|
|
|
A declaration (prototype) describes an object (function, class, variable).
int some_function(int some_arg);
A definition (implementation) implements an object.
int some_function(int some_arg)
{
int result = 0;
return result;
}
If there is no declaration for an object, the definition implies the declaration.
The compiler needs a declaration when an object is used the first time (accessing a variable, calling a function). So there is no need for a declaration if the first usage is located after the definition in the source code.
While strictly speaking all declarations are forward declarations, the term is mainly used with function declarations in header files where a pointer or reference to another class is passed as function argument. An example:
class OtherClass;
class MyClass
{
MyClass();
SomeFunction(OtherClass &otherClass);
}; The implementation file of MyClass must still include the header file containing the OtherClass declaration. But the above header file must not do so which reduces the compile time. More important, this must be used when both classes use the other which would normally require that both header files include each other which would lock the compiler (recursive inclusion).
See also this SO thread: c++ - What is the difference between a definition and a declaration? - Stack Overflow[^]
|
|
|
|
|
The compiler needs a declaration when an object is used the first time (accessing a variable, calling a function). So there is no need for a declaration if the first usage is located after the definition in the source code.
Perfect answer - that is exactly why my test function - first one in header file - did not need declaration.
Jochen,
I really appreciate your help - always right to the point. Thanks
PS
Are you by any chance teacher / instructor ? You sure know how to explain stuff.
Cheers
Vaclav
|
|
|
|
|
Thank you.
I'm not a teacher. I'm an R&D engineer (hardware and software).
|
|
|
|
|
A function definition is also a declaration if there was none so far. The compiler (not the IDE) will add it to it's internal declaration list when processing such a function.
|
|
|
|
|
Hi
I have C/C++ solution/project
The parent process is C the child process is MFC C++.
Each in its own project
The C project has a number of threads.
I have a quad core laptop.
Is there any way of knowing how many cores the .exe(s) is/are using. Don't know if task manager is the answer.
More so can I have an affinity of a thread to a core ?
Thanks
|
|
|
|
|
It is all handled by the operation system. Don't care about. While it is possible to set a thread affinity it is usually not necessary and often counterproductive.
If a process has multiple threads it will use multiple cores when available. But there is no single core assigned to a specific thread. The OS assigns the cores so that a thread runs on different cores.
|
|
|
|
|
Is there anything in task manager or VS debugger or maybe the Kernal debugger that would show me any information about this
Thanks
|
|
|
|
|
Showing information about the core that runs a specific thread makes no sense due to the fast switching between the cores.
For process information have a look at the Sysinternals Suite[^].
|
|
|
|
|
Thanks so much 
|
|
|
|
|
I wanted to make a program like this:
A bank in Indonesia want to create a program using the order of priority. The purpose of this program is to provide the serial number to its customers. No sequence given later be called by the program so that customers who have no it can go to the teller who had been appointed.
The problem in the bank there is a priority system that puts people who have a priority, so that when the customer has priority can be called up in advance from customers who do not have a priority. Create a program using DLLC to overcome this!
|
|
|
|
|
|
Sorry, but no one here is going to do your work for you. Give it a try, and if you have a specific technical question then come back and people will try to help you.
|
|
|
|
|
Okay, and?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
Yudha Eka Saputra wrote: Create a program using DLLC to overcome this
No thanks. I would change banks if my bank started treating customers this way.
Speed of sound - 1100 ft/sec
Speed of light - 186,000 mi/sec
Speed of stupid - instantaneous.
|
|
|
|
|
Hi...
I am trying to migrate a large MFC solution from VS2005 to VS2015. The solution contains 170 projects. After a lot of work, all projects compile and 168 of them link. One that does not link is petty, but pesky, and I may return to that in another post. The other that does not link is the project that generates the program executable.
* The error that it generates is LNK1104: Cannot Open 'mfc80d.lib'.
* If I ignore MFC80d.lib, I get LNK1104: Cannot Open 'mfcs80d.lib'.
* If I ignore that, I get LNK1104: Cannot Open 'daouuid.lib'
* And if I ignore that, I get any number of undefined externals such as CRect::...(), CSize::...(), CFile::...() and so on. This is presumably because I am not linking MFC at all.
I have found a lot of discussion about this but none of it seems to help me. I can find no explicit or implicit references to MFC 8 in my properties or any project file. I have searched for 'mfc80d' both internally in VS2015 and externally in the Windows 7 search tool.
My target platform is 8.1 and my platform toolset is 140.
I will begin configuring a release build next week after the new year.
Can anyone offer any suggestion?
If I may slip in a second question, do I need to worry about migrating DAO?
Thank you very much for any help that you can offer and have a Happy New Year.
SPC
S.P. Chapman
Digital Engineer
Radiant Technologies, Inc.
Albuquerque, NM.
radiant@ferrodevices.com
|
|
|
|