|
Maybe look into the SendInput Function[^] or the keybd_event Function[^].
I'm not sure how all those Sleep() calls effect your user interface. You're on your own there
Mark
Mark Salsbery
Microsoft MVP - Visual C++
This episode brought to you by the letter Z
|
|
|
|
|
I have an MFC app, developed on windows XP, that makes use of the alpha blending features of comctl32.dll version 6.0. I now need to make that app back compatible to Windows 2000, which only supports version 5.8.
Is there some way to install comctl32.dll version 6.0 onto Windows 2000? My app specifies the comctrl version through a manifest (see below), but as far as I can see Windows 2000 doesn't have a GAC.
<dependency>
<dependentassembly>
<assemblyidentity
type="win32"
="" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorarchitecture="X86" publickeytoken="6595b64144ccf1df" language="*">
Aaron Stibich
|
|
|
|
|
astibich2 wrote: Is there some way to install comctl32.dll version 6.0 onto Windows 2000?
I don't think so.
Shell and Common Controls Versions[^]
Mark
Mark Salsbery
Microsoft MVP - Visual C++
This episode brought to you by the letter Z
|
|
|
|
|
Hello all
I have a C program that basically functions as a control loop for a DC motor. Right now, the program is two threads, one that forms a user interface where I can change parameters, and the other runs a loop to update the command to the motor. Parameters are stored in global variables accessable to both threads.
I would like now to make MATLAB able to modify these global variables or otherwise communicate with the control loop thread. Does anyone have an idea of how to open a communication channel like this? The first thing that came to my mind was just using a simple UDP socket, but I lack the proper toolbox to implement that.
Thanks in advance,
Greg
|
|
|
|
|
|
gregdachs wrote: I would like now to make MATLAB able to modify these global variables or otherwise communicate with the control loop thread
I think MATLAB has a good COM interface.
|
|
|
|
|
I have a Linker problem in VCPP600.
after migrating the Source code to a new directory, the linker insits in linking with nafxcwd.lib, as well as mfc42d.lib, which of course leads to conflicts. The Manifest Constant _AFXDLL is set, and have an #ifndef _AFXDLL/n #error 'Gotcha' implicidly or expilcitly in each file associated with the project. None of these fire!
the DSP File does not mention 'nafxcwd.dll' anywhere. Where do I go from here.
LateNightsInNewry
|
|
|
|
|
Hi,
I know that a constructer is not suppoused to return value, however what if my object is dependent on certin data and the constructer which lets say takes a string
as paramter finds that the data is in error is there anyway to tell this to the user of the object and maybe not create the object
Thankx
|
|
|
|
|
I think u can throw a exception in your constructor
|
|
|
|
|
|
If you throw an exception in the constructor the object will not be constructed and thus will not be usable.
Steve
|
|
|
|
|
Constructors do not return values, but can throw exceptions. (If constructors could give an error return value, by logical extension you would have to test every constructor, which would include declarations like 'int i=0')
The YACC concept would be that the effective return value of a costructor is the object it constructs. The constructor cannot return a 'Non'object, and proceed from there, it can only succeed or fail.
So, if the string data is in error, throw an exception.
An easier method is, to separate the Construction and Initialisation process, and write a method such as Init() which CAN return Value!
LateNightsInNewry
|
|
|
|
|
|
"http://blog.csdn.net/xiaolongzhou1225/archive/2006/09/10/1204218.aspx" will be your help
|
|
|
|
|
|
Why dont you go for parameterized constructor instead..
Use call by ref concept. Is this useful. Just pass one more argument in constructor as out parameter. retrun thru out parameter.
class CMyCls
{
public:
CMyCls(){}
CMyCls(CString str,int &nRet)
{
if(some thing1)
nRet = your value;
else if(some thing2)
nRet = your value;
else if(some thing2)
nRet = your value;
else
nRet = your value;
}
};
void main()
{
<big>int result = 0;</big>
class CMyCls obj("hello",<big>result</big>);
}
I dont know what you expecting. But hope this is useful 2 u.
Nice talking to you. If you judge people, you have no time to love them. -- Mother Teresa
|
|
|
|
|
if the result is not what I want then I dont really need the objext created
some have suggested a Throw/exception might do the trick
|
|
|
|
|
i want to create a hook which prevents file creation in my system... i want to prevent exe files being copied to my system. i thought i can do that by using the WM_GETMESSAGE in setwindowshookex... it works for keypress and other messages and if i know the messages for file system i can do what i thought... is it a different concept of handling the file system? hope i can get an answer from forum... if more information is needed from me i can post this again...
|
|
|
|
|
you can use api hook to hook "CreateFile" win32 api which I've invoked and find it's not stable,in IFS(Installable File System),you will use filter driver to get the creation flag and "filemon" source code will be your help.If you're interesting in such,please contract me in eraccn@gmail.com and I've got the "filemon" source code and some document about these.
|
|
|
|
|
hi all. i am trying to accomplish a very simple task but am being bogged down with a linker error that i cant resolve!!
i am making a class with an ofstream object and initializing the object is the constructor...very straightforward.
here is the code:
simpleTask.h
--------------
static ofstream dg_video; // i need static for other reasons (that shouldn't be the reason)
simpleTask.cpp constructor
---------------------------
ofstream dg_video("replay.txt", ios::out);
linker error
---------------
error LNK2001: unresolved external symbol "public: static class std::basic_ofstream<char,struct std::char_traits<char=""> > dg_scenario::dg_video" (?dg_video@dg_scenario@@2V?$basic_ofstream@DU?$char_traits@D@std@@@std@@A)
1>.\spring___Win32_Debug\spring.exe : fatal error LNK1120: 1 unresolved externals
--
dg
|
|
|
|
|
Static members need to be defined outside the class declaration.
In simpleTask.cpp you could add (outside of any method):
ofstream CsimpleTask::dg_video("replay.txt", ios::out);
and remove the line from the constructor (which is actually creating another automatic ofstream
variable).
Mark
Mark Salsbery
Microsoft MVP - Visual C++
This episode brought to you by the letter Z
|
|
|
|
|
OK. That's progress but doesn't quite fix the problem. I am getting no linking errors but now the text that I want to print into the file is not being printed..
here is the updated source code (only the changes I've made).
line outside of any methods or constructors in simpleTask.cpp
--------------------
ofstream CsimpleTask::dg_video("replay.txt", ios::out);
lines in the constructor
--------------------
CsimpleTask::dg_video << "-- INITIAL STATE --\n\n";
CsimpleTask::dg_video << "Object: dg_bead \n";
CsimpleTask::dg_video << "position: " << bead->getCenter().x << " " << bead->getCenter().y << " " << bead->getCenter().z << "\n";
CsimpleTask::dg_video << "dynamics: " << bead->getDynamics() << "\n";
CsimpleTask::dg_video << "being_grabbed: " << bead->isBeingGrabbed() << "\n\n";
CsimpleTask::dg_video << "-- SENSOR INFORMATION --\n\n";
the stuff that I'm printing in the constructor is not shown when I view the file after running the app..
any ideas why? solutions?
--
dg
|
|
|
|
|
Are you actually creating a CsimpleTask object so the constructor gets called?
(I'm assuming you're referring to the CsimpleTask class constructor)
Mark
Mark Salsbery
Microsoft MVP - Visual C++
This episode brought to you by the letter Z
|
|
|
|
|
Yes I am creating the object. And yes, your assumption is correct.
--
dg
|
|
|
|
|
Since the static object won't be destructed until the process terminates, you may need to add
CsimpleTask::dg_video.flush();
after writing to the stream.
Otherwise, something else is going on - I'd need to see the code.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
This episode brought to you by the letter Z
|
|
|
|