|
|
I have placed two buttons in a cstatic. I have added this static as a child control in a status bar. The buttons highlight state is not udpdated even if the mouse pointer is taken out of the button after lbuttondown. How does the same work fine if the buttons are placed in a dialog?
Thanks
|
|
|
|
|
These are push button types? What highlight state are you referring to?
Mark
|
|
|
|
|
hi
i want to know if we can open and close the USB port and if we can how ?? and how we can get the data from any device such a mouse connected with the USB ???
ahmad al-omar
|
|
|
|
|
You can open the port using CreateFile() function -eg. CreateFile("usb0001") -. Then get the file handle returned by the function and deal with it as you would read/write data from/to a file.
Regards
|
|
|
|
|
To my fellow programmers, I come forth again with another issue.
For review, I am reading from an MS Access database into a console app. In the database, I have data all being read by the console app as strings. However, there are two pieces of data I wish to convert from string to integer. Here is the code:
<br />
CoInitialize(NULL);<br />
try<br />
{<br />
_RecordsetPtr pGetInfo("ADODB.Recordset");<br />
_bstr_t strMyDB("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=FinalDB.mdb");<br />
pGetInfo->Open("SELECT * FROM [Video];", strMyDB, adOpenKeyset, adLockOptimistic, adCmdText);<br />
pGetInfo->MoveFirst();<br />
while (!pGetInfo->EndOfFile)<br />
{<br />
sID = (char*) ( (_bstr_t) pGetInfo->GetFields()->GetItem("Vid_ID")->GetValue() );<br />
sTitle = (char*) ( (_bstr_t) pGetInfo->GetFields()->GetItem("Vid_Title")->GetValue() );<br />
sFormat = (char*) ( (_bstr_t) pGetInfo->GetFields()->GetItem("Vid_Format")->GetValue() );<br />
pGetInfo->MoveNext();<br />
iIndex++;<br />
}<br />
pGetInfo->Close();<br />
}
Now, thanks for the answer to VuNic and CoffeeAddict(##), I am supposed to itoa() the (char*) as so:
<br />
iVidTotal = itoa(sAmount);
iAvailable= itoa(sAvailable);
However, eh... ... when I compile under MS's IDE 2003, I get that the itoa() doesn't take only 1 argument. When I checked the MSDB, it requires three arguments, each I have no certain idea what they do. Just remember, I have the header <stdlib.h> in my header file, just to let you guys know. So, yeah.... I thank you guys in advanced.
Like a friend said, "TOO GOOD!" ありがとうございます!
|
|
|
|
|
I think you're going the wrong way - maybe you want atoi()
|
|
|
|
|
Wait a minute... are you serious?
Eh, well... Thanks, guys! I thank you and HAND for supplying me with widsom. I was wondering why itoa wasn't working...
As for CoffeeAddict(##) and VuNic, I guess it was a matter of a slip-up, right? A typo?
It's ok - I thank you guys for your time and wisdom. One day, I might lend a hand and lend some wisdom of my own... but that's a long way off. Thanks!!!
Like a friend said, "TOO GOOD!" ありがとうございます!
|
|
|
|
|
You need atoi instead of itoa.
|
|
|
|
|
Hi,
I have a class which will be accessed by two or more threads and I wondered if what I have done is OK or if there is a better way. I have added a CCriticalSection class member which is initialised in the constructor. Then, each class method uses EnterCriticalSection and LeaveCriticalSection.
The problem is that there are 100 instances of this class and I wondered if having so many critical sections was a burden on the operating system. I thought of having a single CCriticalSection static class member but (rightly or wrongly) I figured that I would be unnecessaryly locking access to all instances and could end up with the code being locked most of the time.
I would really appreciate youe views on this. I understand the basics of multithreading but its still a bit of a mystery.
TIA
Tony
|
|
|
|
|
It sounds like you have it right to me.
Using one critical section for all instances could definitely impact performance with only
one thread able to access any object at one time. It's still a viable solution but only if
that's really what you want or need.
I would imagine the only burden on the system is more memory/handles being used for each sync
object. 100 is relatively few. The class instances have to be thread protected so there's not
much choice anyway
I thought the OS was THERE for us to burden
Mark
|
|
|
|
|
Hi Mark,
Thanks very much for your reply. The code appears to work well but its good to have someone else give a quick sanity check on what I have done.
Thanks again
Tony
|
|
|
|
|
i am using unicode
when displaying strings from the string table on a message box
AfxMessageBox(IDS_MSG_STRING, ...);
where IDS_MSG_STRING is an entry in the sting table, the following occure:
1- in debug mode: every thing foes nice.
2- in release mode: the message box pops up as usual but displaying the following string "an unnamed file".
why is that and how to avoid it?
thankx in advance
k_dehairy
|
|
|
|
|
If my project work in "Multithread" and during process in every thread will generate message box for ask user what the way user want to do.
How I check in main program, the message box that occur.
Which thread generate it?
|
|
|
|
|
Use the void pointer (LPVOID) which you pass while creating the thread.
<code>
int threadCount;
AfxBeginThread(YouThread,(LPVOID)threadCount);
UNIT YourThread(LPVOID lp)
{
int threadCount = (int)lp;
yourFunction(threadCount);
}
void yourFunction(int threadID)
{
do
{
itoa(threadID,ch,10)
MessageBox(..ch)
}while()
}
</code>
Code-Frog:So if this is Pumpkinhead. Time for him to run and hide. It's an interesting thought really.
|
|
|
|
|
Or the simpler way is you can simple have a GlobalThreadID, that gets incremented everytime you create a thread, and you assign it the local variable that you will have in the thread function.
Code-Frog:So if this is Pumpkinhead. Time for him to run and hide. It's an interesting thought really.
|
|
|
|
|
Guys,
I ran into this issue during migration of project from .net2003 to vs2005.
Have you guys encountered something similar and fixed the same?
error LNK2019: unresolved external symbol "public: __thiscall std::exception::exception(char const * const &)" (??0exception@std@@QAE@ABQBD@Z) referenced in function "public: __thiscall std::bad_alloc::bad_alloc(char const *)" (??0bad_alloc@std@@QAE@PBD@Z)
error LNK2001: unresolved external symbol "public: __thiscall std::exception::exception(char const * const &)" (??0exception@std@@QAE@ABQBD@Z)
error LNK2001: unresolved external symbol "public: __thiscall std::exception::exception(char const * const &)" (??0exception@std@@QAE@ABQBD@Z)
SharedMemory.obj : error LNK2001:
Vipin
|
|
|
|
|
|
You find your answer
|
|
|
|
|
I originally using Visual Basic 6.0 and .NET.
But, I realized vb is had limited.
so, I'm turning to VC++/MFC.
I knew VB's The general trend is transition to .NET
but, I don't know in VC++.
Is VC++'s trend 6.0? or trend is .NET?
I wandering this problem.
I really appreciate, If i had your reply.
thanks~
Aim High, life is soaring
but, Aim Low, life is boring!
|
|
|
|
|
Always use the correct tool for the job. Personally, I don't think .Net is appropriate for desktop applications, but if the boss says "Use .Net", guess what I'm going to do. In the end, it's all about keeping your job, and maintaining a marketable skill set. You simply have to learn it all. It's fine to be strong in one particular programming language, but you absolutely MUST be at least conversant in most of them.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
i need your help....
with the script that can connect the contain of textbox after the button event to access database....
please.....
|
|
|
|
|
Do you want to insert a text(of editbox) to a database?
|
|
|
|
|
Can anyone have the idea of calling XFS API in .net (C#).
|
|
|
|
|
I think you selected wrong forum here c++
|
|
|
|