|
I think _getch() has a built-in wait so you might try removing the call to _kbhit().
|
|
|
|
|
I needed some processing in the _kbhit loop but using Sleep in the loop solved the problem, thanks
|
|
|
|
|
a) you can lower the thread priority while you wait for input
b) a Sleep(20) won't hurt
c) you can *try* if MsgWaitForMultipleObjects "wakes" your thread when you input a kjey (I doubt that, though)
"Der Geist des Kriegers ist erwacht / Ich hab die Macht" StS
sighist | Agile Programming | doxygen
|
|
|
|
|
Thanks
I simply added a Sleep which did the trick
|
|
|
|
|
Hi,
Is there any method, function or way... to convert from ISO-8601 Date Format (yyyy-mm-ddThh:mm:ss), to COleDateTime ?
I'm tempted to make my own sh*tty function... but reinventing the wheel it's not a good idea... ( at least reinvent a bad wheel ).
Thanks in advance, Greetings
Braulio
|
|
|
|
|
BOOL ParseDateTime( LPCTSTR lpszDate, DWORD dwFlags = 0, LCID lcid = LANG_USER_DEFAULT );
throw( CMemoryException );
throw( COleException );
should do the job (see MSDN for more). This parses your string and sets the COleDateTime.
~RaGE();
|
|
|
|
|
Dear all,
How to access a C# DLL function from a MFC app? Is it possible?
VikramS
|
|
|
|
|
Yes it is possible.
You can do this in two ways.
1. By adding the /CLR compiler option and after that you can use the "#using" keyword to get your dll into MFC. for ex. #using <mycsharpassembly.dll>
You can instantiate the class or type inside your c# dll and call the methods.
Also note that with this your application now compiles to IL instead of x86 code,so unless you intend to compile the entire app to .net, this is not required.
2. Through COM Interop.
By decorating the c# class with COM attributes(mostly GUID) and then using the regasm tool to register the C# dll. Now you got a proper COM component in .net and you can use this MFC like how you access normal COM components.
Cheers,
Kannan
|
|
|
|
|
Ya.. I got it..that is really nice soln. Now I want to pass a safearray of strings to that C# DLL. how to do this?
|
|
|
|
|
I think you need to change your mail id for the ms programs to work , okay just kidding.
I have never tried this, but start looking into
MarshalAsAttribute.SafeArraySubType or UnmanagedType.SafeArray
as function parameters in c#
Cheers,
Kannan
|
|
|
|
|
Thank you..MarshalAsAttribute.SafeArraySubType works nicely.Anyway I love linux and windows both
Vikram
|
|
|
|
|
vikrams wrote:
Anyway I love linux and windows both
Cheers,
Kannan
|
|
|
|
|
|
Caïra wrote:
and I want it begins automatically after the display of the dialog Box
Where I have to place AfxBeginThread(...) ?
Right before the dialog box call (so before AfxMessageBox in this case).
~RaGE();
|
|
|
|
|
Set the dwCreateFlags parameter to CREATE_SUSPENDED.
CWinThread* pThread = AfxBeginThread(pfnThreadProc, pParam, THREAD_PRIORITY_NORMAL, 0, CREATE_SUSPENDED);
When you are ready for the thread to start execution call this:
pThread->ResumeThread();
Jonathan Craig
www.mcw-tech.com
|
|
|
|
|
Hi friends,
i have an application which takes some inputs from a [B]SERIAL PORT RS232[/B] , so for using that application which is installed on some other system i need to desgin a mediator which will send command to that aaplication through my [B]SERAIL PORT[/B] so friend s please provide me some help how to start with such module which interacts with Serial port.
Also i have one query if i install both software my [B]HOST(WHICH PUSH COMMANDS TO CONTROL SYSTEM)[/B] AND [B]CONTROL SYSTEM(WHICH ACCEPTS COMMANDS AND SENDS BACK ACKNOWLEDGEMENT TO HOST)[/B] then will they be able to interact fine or i need to install them on diffrent machine and connect them through SERAIL CABLE.
waiting for a reply
deepak
|
|
|
|
|
The simplest method is use
<code>hPort = CreateFile ("COM1",
GENERIC_READ | GENERIC_WRITE,
0,
NULL,
OPEN_EXISTING,
0,
NULL);</code>
Look in the MSDN for "Programming Serial Connections", this should be OK unless you need something more advanced, but I don't think you do.
<HR SIZE=1 /HR>
<i>If I have seen further it is by standing on the shoulders of Giants.</i> - Isaac Newton 1676
|
|
|
|
|
Thanks Ted,
I have written code, there is no problem in this.Now the problem is that i have my applictaion will talk to another application which is on another machine.Both machine are connected by NULL MODEM SERIAL RS232 cable.So i need to write and read from my COM port.So i have to desgin my program in such a way that whwenver any data comes from another machine to my port i raed it and similteanosly i can also write to it for the second application.
Hope u will help me
Deepak
|
|
|
|
|
hi all,
i want to do https authentication programatically , i mean without the use of browser.
is there any way to do.
any libraries.
TIA
regards
tarun
|
|
|
|
|
Try the OpenSSL library (www.openssl.org[^]). It's complex, but so is SSL. It's probably the best SSL library around.
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
thanks a lot for pointer
-regards
tarun
|
|
|
|
|
You're welcome
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
Hi There
i have a list control which contains a list of numbers
i want to loop through each item and add them to a CString
so my CSTring would = "45466,4554,767567,88674,34535,66654,66565"
ive got as far as loop through the List Ctrl but i dont know how to
create the string, by appending each item
any1 ne ideas
thanks
simon
void CSelectStudents::CreateGroupList(void)
{
for (int f=0; f< m_studentlist.GetItemCount(); f++)
{
CString stud_id = m_studentlist.GetItemText(f,3);
}
}
|
|
|
|
|
you may use somthing like this
CString stud_id +=
|
|
|
|
|
si_69 wrote:
void CSelectStudents::CreateGroupList(void)
{
CString stud_id;
stud_id.Empty();
for (int f=0; f< m_studentlist.GetItemCount(); f++)
{
stud_id += m_studentlist.GetItemText(f,3);
}
}
~RaGE();
|
|
|
|