Hi, I've a problem when using Carlos Antollini ADO class in a "realtime" application. What I do is, that I call a thread that does all the database operations once every 10 minutes or so. But it seems like the database operations are not called asyncron, because the other threads within the application get freezed!? Would be great if you could give advice, otherwise I've to rewrite the whole DB part :sigh: Thanks Mario m_hThread = (HANDLE) _beginthreadex(NULL,0,_ThreadWriteToDB,this, 0,&nDummy); UINT WINAPI CDBManager::_ThreadWriteToDB(LPVOID pParam) { ASSERT(pParam); CDBManager *pDBMan = reinterpret_cast (pParam); DosSetPriority(PRTYS_THREAD, PRTYC_IDLETIME, THREAD_PRIORITY_IDLE, 0); pDBMan->m_Con.BeginTransaction(); ... ... ... pDBMan->m_Con.CommitTransaction(); // this thread has finished its work so we close the handle CloseHandle(pDBMan->m_hThread); }
pma
Posts
-
Performance problems, when using ADO in threads -
copy selected text to my applicationits bad, and its something I've already tried, its working with Notepad and some other applications, but not with Excel, lets sys generaly:(( Maybe some others have already solved such a thing in the past and can help us out here. Thank you anyway
-
copy selected text to my applicationwell thats clear :rolleyes:, I like to copy the text, open my application and paste this text automaticly. And also the other way round: - press a hotkey - my application copy's the text into clipboard - go-back to the window where we came from - paste the text The problem is not to copy/paste to the clipboard. The problem is how to hook the hotkey with my application, then go back to where the user came from and copy the text into the clipboard. After that my program needs the focus again and has to paste the clipboard content into my application.
-
copy selected text to my applicationHi, I'd like to copy the selected text of any other application with a system-wide-keyboard-shortcut automaticly to my application. Should be working like in Babylon Translator. Maybe someone can guide me to good starting point, or better has some code that might help me. Thank you Mario
-
Multicolor CEdit ??is it possible to have multible colors for one string in a CEdit box
-
udb brodcastI'd like to have a application that is both server and client, if the application starts, it checks if another instance of this application is running on another server on the same LAN, if so it should send back some indification message. So I suppose I've to send a udb-broadcast with the server-part of the application, the other instance receives this braodcast with it's own server part and send's back a message to the other instance with the client part. Maybe someone can give a link to a source code sample :confused: Thank you Mario
-
Wired Message Routing ProblemI've the following situation: MFC Dialog based Application \_CMainDlg \_CMainDlg So the CMainDlg opens another dialog of the same type: m_DoubleCalc = new CMainDlg (NULL, IDD_CALC_DIALOG_MINI); m_DoubleCalc->Create(IDD_CALC_DIALOG_MINI, this); The 2 Dialogs are running at the same time, the problem is that it seems like that the previous CMainDlg eats messages from the other CMainDlg it has created. The wired thing is some messages seem to work while other dont. I'am searching now for hours, but I still have no clue. Thank you Mario
-
Excel <-> Application clipboard data transferHello, I've the following problem, I like to have to system-wide keyboard shortcuts (I know how to do that) that to the follwowing thing: If I press shortcut_1 I like to copy the actual Excel cell-data into the clibboard change to my application and paste it there. If I press shortcut_2 I like to copy the actual data from my application and paste it into the actual excel cell. How to I automate Excel to achive my goals. Thank you Mario
-
Restarting a running programThank you all!
-
Restarting a running programHi, how to I restart my program from its own. Now I do it with a batch file, it looks like this: 1) process starts a batch-file 2) process stops 3) batchfile waits 2 seconds 4) batchfile starts the process again Has anybody a better solution ? Thank you, Mario
-
Maximize dialog based app on startupHi, I need a proper way of keeping a window maximized all the time. On startup its quite easy, I just call: ShowWindow(SW_SHOWMAXIMIZED); But the problem is if the user minimizes the window and then reopens it, then it wont be maximized again. Thank you for your help Mario
-
dial-up connectiontry to use rasdial from Dundas Software, its free and comes with source code !
-
Network Spy ( Internet Spy )go to http://winpcap.polito.it for more details !
-
SNMP response timebut this is with all servers/workstations, is there any way to boost the priortiy, do you have a glue how other programs might do that ? mario prem
-
File Openuse "\\\\servername\\....\\test.txt" and it will work
-
Determine when I am connected on LANtry to use SNMP, but thats not trivial, i'am currently working on the same thing ;-)
-
SNMP response timei've written a snmp class that uses winsnmp, i'am facing a problem when quering a Win2000 or WinXP snmp agent, the response time is more than 10ms. i've seen applications that can do that much faster like my code, any suggenstions ?? Thank you!
-
Determine when I am connected on LANMaybe you use this code, its working for all known cases. ok, its working at least for all my cases bye mario 1) InternetCheckConnection ( Checks for Google ) 2) InternetAttemptConnect ( Windows Function ) 3) IsModem Connected ( Modem Connection ) 4) gethostbyname ( Google ) 5) InternetGetConnectedState ( LAN ) 6) Dont check for Internetconnection // Check if Online BOOL WINAPI IsADSLConnected() { LPDWORD lpdwFlags=0; DWORD dwReserved=0; RASCONN rc; rc.dwSize = sizeof(rc); DWORD numConns=0; DWORD size=0; DWORD res; do { switch(g_m_ConMode) { case 0: try { g_IsConnected=InternetCheckConnection("http://www.google.com",FLAG_ICC_FORCE_CONNECTION ,0); } catch(...) { g_m_ConMode = 4; } break; case 1: res = InternetAttemptConnect(0); if(res == ERROR_SUCCESS) g_IsConnected = 1; else g_IsConnected = 0; break; case 2: // Enumerate the connections. res = RasEnumConnections(&rc, &size, &numConns); if (numConns > 0 || InternetGetConnectedState(lpdwFlags,dwReserved)) g_IsConnected = 1; else g_IsConnected = 0; break; case 3: if (gethostbyname ("www.google.com")) g_IsConnected = 1; else g_IsConnected = 0; break; case 4: g_IsConnected = 0; if (::InternetGetConnectedState (&dwReserved, 0)) { if ((dwReserved & INTERNET_CONNECTION_LAN) || (dwReserved & INTERNET_CONNECTION_MODEM) || (dwReserved & INTERNET_CONNECTION_PROXY)) { g_IsConnected = 1; } } break; case 5: g_IsConnected = 0; break; } Sleep(2500); } while(1); }
-
Get router statsi've written a up/download monitor and i want to include a feature that allows be to monitor routers, has anybody an idea how to do that ? Thanks Mario
-
Traffic Control APIMaybe somebody of you can guide me you to use the QoS SDK in order to use it as a Bandwidth Manager. I've searched for hours but without any success, maybe there is an tutorial or source code available. thank you Mario