Hi, http://www.functionx.com/win32/Lesson07.htm [^] "A window can display one to three buttons: Minimize or , Maximize or , Close or . " My quesiton is : How can i change these buttons to XP style in Console Application? can i? Thanks in advance. :) -------------------------------- -> Hell's Best Kept Secret ! -> Welcome to myBlog
IsaacLitingjun
Posts
-
How to change the button style of Console Application -
"Wave" buffer -> "A - law" buffer Transforming QuestionGod Bless. :) ________________________________________ Many nights we've prayed with no proof anyone could hear, we were moving moutains long before we knew we could! Yet now i'm standing here, although we know there's much to fear, hope seemed like summer bird too swiftly flown away ... There can be miracles! When you believe, though hope is frail, it's hard to kill! Who knows what miracles, you can achieve! When you believe, somehow you will ... YOU WILL WHEN YOU BELIEVE
-
"Wave" buffer -> "A - law" buffer Transforming QuestionHi,Everyone: i need to transform a "wave format" buffers into "A-Law format" buffers, could you give me some hints? i found a link: http://sox.sourceforge.net/[^] but it's so complicated for me... :doh::sigh: do we have some simple methods? Thanks. :) ________________________________________ Many nights we've prayed with no proof anyone could hear, we were moving moutains long before we knew we could! Yet now i'm standing here, although we know there's much to fear, hope seemed like summer bird too swiftly flown away ... There can be miracles! When you believe, though hope is frail, it's hard to kill! Who knows what miracles, you can achieve! When you believe, somehow you will ... YOU WILL WHEN YOU BELIEVE
-
Runtime ErrorHi,Everyone: when i build the program in server machine, it runs well; but if i build it in local machine and upload, then i got a Runtime Error.
-Microsoft Visual C++ Runtime Library- d:\vcydcj.exe abnormal program termination.
is it normal, cos the difference of Op-System? Server Machine: Windows 2000 Professional Local Machine: Windows Xp & it seemed problem happened when it runs to these code:CADOParameter pParamIn_Readnum(CADORecordset::typeInteger, sizeof(int)); pParamIn_Readnum.SetValue(pMydoc->rwbossdlg.m_nReadNum); CADOCommand pCmd(pAdoDb_RB, "ydcj_getdata_574"); pCmd.AddParameter(&pParamIn_Readnum); pRs_RB = new CADORecordset(pAdoDb_RB); pRs_RB->Execute(&pCmd));
Thx! ________________________________________ Many nights we've prayed with no proof anyone could hear, we were moving moutains long before we knew we could! Yet now i'm standing here, although we know there's much to fear, hope seemed like summer bird too swiftly flown away ... There can be miracles! When you believe, though hope is frail, it's hard to kill! Who knows what miracles, you can achieve! When you believe, somehow you will ... YOU WILL WHEN YOU BELIEVE -
How to create shared memory among processeshttp://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base/creating_named_shared_memory.asp[^] ________________________________________ Many nights we've prayed with no proof anyone could hear, we were moving moutains long before we knew we could! Yet now i'm standing here, although we know there's much to fear, hope seemed like summer bird too swiftly flown away ... There can be miracles! When you believe, though hope is frail, it's hard to kill! Who knows what miracles, you can achieve! When you believe, somehow you will ... YOU WILL WHEN YOU BELIEVE
-
access violation at 0x00000000Thanks,PJ Arends! But in my program i didn't use message handlers :doh: (i planned to use once, but now i didn't use it. Maybe cos i remained the definition?? )
#define WM_OPENRECORD WM_USER + 100 // #define WM_STARTCALL WM_USER + 101 //
and i found i made a stupid mistake:while(1) { pRs = new CADORecordset(pAdoDb); while(DB_CONNECTED) { Dosomething(); if(DB_problem)break; } }
it seemed i forgot to "delete pRs"!while(1) { pRs = new CADORecordset(pAdoDb); while(DB_CONNECTED) { Dosomething(); if(DB_problem)break; } // 20050131 Modified by Dick delete pRs; }
maybe this cause the problem? i'm not sure, now i'm letting the program run and watch whether i get next error. (if i do get, i'll go to ask you again,hope you don't feel it's a trouble ;P ) Thank you sooooooooo much! :) Have a good day!! ________________________________________ Many nights we've prayed with no proof anyone could hear, we were moving moutains long before we knew we could! Yet now i'm standing here, although we know there's much to fear, hope seemed like summer bird too swiftly flown away ... There can be miracles! When you believe, though hope is frail, it's hard to kill! Who knows what miracles, you can achieve! When you believe, somehow you will ... YOU WILL WHEN YOU BELIEVE -
access violation at 0x00000000In My CvcydcjDoc Class, i have such kind of memory to store data.
class CvcydcjDoc : public CDocument { protected: // create from serialization only CvcydcjDoc(); DECLARE_DYNCREATE(CvcydcjDoc) // Attributes public: struct MEM_MEMORY{ int State;// char szBz[100];// int nCjzcs; // int nSbzcg; // int nZdcjcs; // char szZje[12]; // int nCjcgcs; // int nZdcjcgcs; // int nCjymcs; // int nZdcjsbcs;// char szRowid[20]; char szCjzt[2];// ... }; MEM_MEMORY memRead[2000];
and in my thread, i access data using this way: 1. First i get the Doc pointer:CMainFrame* pMainFrmWnd = (CMainFrame*)AfxGetMainWnd(); ASSERT(pMainFrmWnd != NULL); CvcydcjView* pMyView = NULL; CWnd* pchildWnd = pMainFrmWnd->GetWindow(GW_CHILD); ASSERT(pchildWnd->GetSafeHwnd() != NULL); //while(pchildWnd->GetSafeHwnd() != NULL) //{ // ASSERT(pchildWnd->GetSafeHwnd() != NULL); // if(pchildWnd->GetRuntimeClass()->m_lpszClassName == "CvcydcjView") // { pMyView = (CvcydcjView*)pchildWnd; // break; // } // pchildWnd = pchildWnd->GetWindow(GW_HWNDNEXT); //} ASSERT(pMyView != NULL); CListCtrl* pList = (CListCtrl*)pMyView->getItem(IDC_LIST_DIAL); CListCtrl* pListMsg = (CListCtrl*)pMyView->getItem(IDC_LIST_MESSAGE); CStatic* pCjcount = (CStatic*)pMyView->getItem(IDC_CJCOUNT); CStatic* pCjymcount = (CStatic*)pMyView->getItem(IDC_CJYMCOUNT); CStatic* pCjcgcount = (CStatic*)pMyView->getItem(IDC_CJCGCOUNT); CStatic* pCjcscount = (CStatic*)pMyView->getItem(IDC_CJCSCOUNT); CvcydcjDoc* pMydoc = (CvcydcjDoc*)lp;
then i manipulate that data in this way:... strcpy(pMydoc->memRead[nRecNumber].szCjzjhm,str); ...
i don't know whether it's the problem or not... Hope someone can help me,,, Thx! ________________________________________ Many nights we've prayed with no proof anyone could hear, we were moving moutains long before we knew we could! Yet now i'm standing here, although we know there's much to fear, hope seemed like summer bird too swiftly flown away ... There can be miracles! When you believe, though hope is frail, it's hard to kill! Who knows what miracles, you can achieve! When you believe, somehow you will ... YOU WILL WHEN YOU BELIEVE -
access violation at 0x00000000Hi,Everyone: i'm running a program as form-based, Doc/view struct. i create a thread in the initialization of the program, and in thread, we use while(1) circulation. it runs well usually, but we'll get unexpected error dialog, (and program shut down), this is following error infomation: "access violation at 0x00000000: read of address 0x00000000". Process Stopped. Can any one of you give me some suggestions? Thanks! ________________________________________ Many nights we've prayed with no proof anyone could hear, we were moving moutains long before we knew we could! Yet now i'm standing here, although we know there's much to fear, hope seemed like summer bird too swiftly flown away ... There can be miracles! When you believe, though hope is frail, it's hard to kill! Who knows what miracles, you can achieve! When you believe, somehow you will ... YOU WILL WHEN YOU BELIEVE
-
odbc, dao, oledb, ado database question !These links had helped me a lot, hope also can help you. and the first link i have given you has a very clear introduction and good examples. http://www.codeproject.com/database/caaadoxclass.asp[^] http://www.codeproject.com/database/msdatagrid.asp[^] http://www.codeproject.com/database/msdatagridoledb.asp[^] Best Wishes. - - - - - - - - - - - - - - - - - - - - - - - - Many nights we've prayed with no proof anyone could hear, we were moving moutains long before we knew we could! Yet now i'm standing here, although we know there's much to fear, hope seemed like summer bird too swiftly flown away ... There can be miracles! When you believe, though hope is frail, it's hard to kill! Who knows what miracles, you can achieve! When you believe, somehow you will ... YOU WILL WHEN YOU BELIEVE
-
Wave Format Transforming QuestionHi,Everyone: I got following questions: 1> i want to transform a wave's format to standard format i needed(such as 8000HZ,16 bit,mono,signed) we can use software Goldwave’s “Effects->Resample”. But are there any classes or functions in VC? 2> we aslo want to transform the standard wave (we get from the first step) to A-Law PCM Signals. How can I realize that in VC? Can any of you give me some threads or links? Thank you very much! - - - - - - - - - - - - - - - - - - - - - - - - Many nights we've prayed with no proof anyone could hear, we were moving moutains long before we knew we could! Yet now i'm standing here, although we know there's much to fear, hope seemed like summer bird too swiftly flown away ... There can be miracles! When you believe, though hope is frail, it's hard to kill! Who knows what miracles, you can achieve! When you believe, somehow you will ... YOU WILL WHEN YOU BELIEVE
-
odbc, dao, oledb, ado database question !This is quite a good article! Enjoy it. ;) http://www.codeproject.com/database/caaadoclass1.asp[^] - - - - - - - - - - - - - - - - - - - - - - - - Many nights we've prayed with no proof anyone could hear, we were moving moutains long before we knew we could! Yet now i'm standing here, although we know there's much to fear, hope seemed like summer bird too swiftly flown away ... There can be miracles! When you believe, though hope is frail, it's hard to kill! Who knows what miracles, you can achieve! When you believe, somehow you will ... YOU WILL WHEN YOU BELIEVE
-
VC6 - bug - I desparately need adviceBest Wishes... ;) - - - - - - - - - - - - - - - - - - - - - - - - Many nights we've prayed with no proof anyone could hear, we were moving moutains long before we knew we could ! Yet now i'm standing here, although we know there's much to fear, hope seemed like summer bird too swiftly flown away ... There can be miracles! When you believe, though hope is frail, it's hard to kill ! Who knows what miracles, you can achieve! When you believe, somehow you will ... YOU WILL WHEN YOU BELIEVE
-
How to Access data of Doc in a threadThank you very much! It works :laugh: - - - - - - - - - - - - - - - - - - - - - - - - - - Many nights we prayed with no proof anyone could hear, we were moving moutains long before we knew we could ! Yet now i'm standing here, although we know there's much to fear, hope seems like summer bird too swiftly flown away ... There can be miracles! When you believe, though hope is frail, it's hard to kill ! Who knows what miracles, you can achieve! When you believe, somehow you will ... YOU WILL WHEN YOU BELIEVE
-
How to Access data of Doc in a threadThank you for your reply. we need have a thread dealing with something(like initialize drives,and connect to voice_board and dial ...) and our main functions are all in View class, for example: displaymessage... we store the data in doc class. may i create the thread in my doc class or view class? then i can access the data easiler, but it seems if we create the callout function in view class,we get these errors:
D:\VC YDCJ\vcydcjView.cpp(431) : error C2664: 'CreateThread' : cannot convert parameter 3 from 'int (void)' to 'unsigned long (__stdcall *)(void *)' None of the functions with this name in scope match the target type
thank you and waiting for your reply... thx! - - - - - - - - - - - - - - - - - - - - - - - - - - Many nights we prayed with no proof anyone could hear, we were moving moutains long before we knew we could ! Yet now i'm standing here, although we know there's much to fear, hope seems like summer bird too swiftly flown away ... There can be miracles! When you believe, though hope is frail, it's hard to kill ! Who knows what miracles, you can achieve! When you believe, somehow you will ... YOU WILL WHEN YOU BELIEVE -
How to Access data of Doc in a threadThank you for your suggestion. i create the thread in my view class with following code:
m_hCallthread = CreateThread( NULL, // pointer to security attributes NULL, // initial thread stack size CallOut, // pointer to thread function NULL, // argument for new thread 0, // creation flags NULL // pointer to receive thread ID );
could you tell me how to pass the pointer? thx? i try replace last NULL with this, it didn't work. :doh: sorry, i'm a new bie of vc... wait for your answer... Thank you very much! - - - - - - - - - - - - - - - - - - - - - - - - - - Many nights we prayed with no proof anyone could hear, we were moving moutains long before we knew we could ! Yet now i'm standing here, although we know there's much to fear, hope seems like summer bird too swiftly flown away ... There can be miracles! When you believe, though hope is frail, it's hard to kill ! Who knows what miracles, you can achieve! When you believe, somehow you will ... YOU WILL WHEN YOU BELIEVE -
How to Access data of Doc in a threadHi,everyone: i access my data of Doc using following code:
CMainFrame* pMainFrmWnd = (CMainFrame*)AfxGetMainWnd(); ASSERT(pMainFrmWnd != NULL); CWnd* pchildWnd = pMainFrmWnd->GetWindow(GW_CHILD); ASSERT(pchildWnd->GetSafeHwnd() != NULL); CvcydcjView *pMyView = NULL; while(pchildWnd->GetSafeHwnd() != NULL) { ASSERT(pchildWnd->GetSafeHwnd() != NULL); if(pchildWnd->GetRuntimeClass()->m_lpszClassName == "CvcydcjView") { pMyView = (CvcydcjView*)pchildWnd; break; } pchildWnd = pchildWnd->GetWindow(GW_HWNDNEXT); } ASSERT(pMyView != NULL); CvcydcjDoc *pMydoc; pMydoc=pMyView->GetDocument(); ASSERT(pMydoc != NULL); pMydoc->MyData="demo";
but when i use it in a thread, it didn't work, it seems stopped atpMydoc=pMyView->GetDocument();
can you give me some suggestions? Thx! - - - - - - - - - - - - - - - - - - - - - - - - - - Many nights we prayed with no proof anyone could hear, we were moving moutains long before we knew we could ! Yet now i'm standing here, although we know there's much to fear, hope seems like summer bird too swiftly flown away ... There can be miracles! When you believe, though hope is frail, it's hard to kill ! Who knows what miracles, you can achieve! When you believe, somehow you will ... YOU WILL WHEN YOU BELIEVE -
A question about GetDlgItem:) - - - - - - - - - - - - - - - - - - - - - - - - - - Many nights we prayed with no proof anyone could hear, we were moving moutains long before we knew we could ! Yet now i'm standing here, although we know there's much to fear, hope seems like summer bird too swiftly flown away ... There can be miracles! When you believe, though hope is frail, it's hard to kill ! Who knows what miracles, you can achieve! When you believe, somehow you will ... YOU WILL WHEN YOU BELIEVE
-
Can anyone give me a simple demo code to use User Define Messages or any links.( Thx in advance. )i have function A and B.
A { Finished(); SendMessage(); } ////////////////////////////// B { if( RECEIVE_MESSAGE ) { StartDoingsth(); } }
Can i realize that? - - - - - - - - - - - - - - - - - - - - - - - - - - Many nights we prayed with no proof anyone could hear, we were moving moutains long before we knew we could ! Yet now i'm standing here, although we know there's much to fear, hope seems like summer bird too swiftly flown away ... There can be miracles! When you believe, though hope is frail, it's hard to kill ! Who knows what miracles, you can achieve! When you believe, somehow you will ... YOU WILL WHEN YOU BELIEVE -
A question about GetDlgItemThxs! a million,Rahim. You're so kind! so i'd love to ask you another question, your solutions are always Great!! Rahim Rattani wrote: before initiating the thread i think maybe there will be some diffiulties,we initialize the thread in view class. but that's ok, i think now we can use the control using your getitem method, so coooooooool! :laugh: now i got another question,wish you can take a look: i want to use message method, but i don't have a very clear idea about how to use it. here is the circumstance: there is a process running in my CvcydcjView:
int CvcydcjView::ReadRecord() { OpenDatabase(); CopytoMemory(); //when i finish this process, i want to sendmessage to the thread now it can start SendMessages(); }
DWORD WINAPI CallOut(LPVOID lp); { if(ReceiveMessageFromReadRecord) DoSomething(); else Wait(); }
i don't know how to write the code, if you can help, that will be very Great!!!!!!!! Thanks in advance!!!!!!!!!!! Best Wishes, - - - - - - - - - - - - - - - - - - - - - - - - - - Many nights we prayed with no proof anyone could hear, we were moving moutains long before we knew we could ! Yet now i'm standing here, although we know there's much to fear, hope seems like summer bird too swiftly flown away ... There can be miracles! When you believe, though hope is frail, it's hard to kill ! Who knows what miracles, you can achieve! When you believe, somehow you will ... YOU WILL WHEN YOU BELIEVE -
A question about GetDlgItemRahim Rattani wrote: The below is the public function CWnd* CvcydcjView::getItem(UINT p_nResourceID) { return GetDlgItem(p_nResourceID); } Hi,Dear Rahim:
//while(pchildWnd->GetSafeHwnd() != NULL) // { // ASSERT(pchildWnd->GetSafeHwnd() != NULL); // if(pchildWnd->GetRuntimeClass()->m_lpszClassName == "CvcydcjView") // { pYourView = (CvcydcjView*)pchildWnd; // break; // } // pchildWnd = pchildWnd->GetWindow(GW_HWNDNEXT); // }
then i can get pYourView rightly - - - - - - - - - - - - - - - - - - - - - - - - - - Many nights we prayed with no proof anyone could hear, we were moving moutains long before we knew we could ! Yet now i'm standing here, although we know there's much to fear, hope seems like summer bird too swiftly flown away ... There can be miracles! When you believe, though hope is frail, it's hard to kill ! Who knows what miracles, you can achieve! When you believe, somehow you will ... YOU WILL WHEN YOU BELIEVE