|
|
Hi all,
Could someone please help me with (information | use on) wildcards in VC++.
Thank you very much in advance.
Regards
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
what do you want to do with wildcards?
|
|
|
|
|
I want to get all the files with a certain extension (example: *.bir) and then my TCP/IP server must send those files to the remot client. Whats why I want to know how to use wildcards...
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
Programm3r wrote: I want to get all the files with a certain extension (example: *.bir)
the FindFirstFile/FindNextFile API will do both of those things for you.
|
|
|
|
|
Thank you very much Chris ... I was not aware of that...
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
Hi,
I'm having a DLL that exports a class. Each instance of this class should be able to create its own window. Therefore I created a WindowProc class member to process messages to the created window.
While trying to register a window class for my class I tried to configure the message processing by filling the lpfnWndProc field of WNDCLASSEX structure with a pointer to WindowProc. I couldn't get this to compile if the WindowProc function is not *static*. This is not acceptable because this means all instances of my class share the same WindowProc so I don't know which instance should process the messages.
What is the appropriate design to do what I want ?
Thanks
|
|
|
|
|
This is because the functions don't have the same prototype: for the member function, there is a implicit parameter passed, the this parameter (allowing the function to know to which instance it belongs to).
To overcome this problem, when you create your window (use CreateWindow), you can pass a pointer to user data. Pass the this parameter, so that the first time your static window procedure gets called, it will receive the instance of the class. Then, register this pointer with SetWindowLong (it will associate the instance pointer with the handle of the window):
if (Msg == WM_CREATE)<br />
SetWindowLong(hWnd, GWL_USERDATA,(long) ( (LPCREATESTRUCT(lParam))->lpCreateParams));
Then, after each call of your static procedure, you are able to retrieve the class instance and call a public non-static window procedure:
CMyClass* pClass = (CMyClass*)GetWindowLong(hWnd,GWL_USERDATA);
hWnd is the handle of the window passed as parameter to the procedure. Check the different functions in the doc for more details.
Hope this helps
|
|
|
|
|
Thanks,
This solves my problem. I might be using a "std::map<hwnd, cmyclass*="">" instead to find the class instance knowing the hwnd but the idea is the same. I mostly wanted to check that it's not a bad design have the same WindowProc for all my instances and therefore have to lookup the class instance everytime.
|
|
|
|
|
Tnarol wrote: I might be using a "std::map" instead
You'll have to make it static so that all instances share the same map than.
|
|
|
|
|
|
Hello !
I'm a student in a french engineering school (ECE) and we (me and some mates) are working on a project (a voice recognition lock).
We are actually looking for a source showing the use of Fast Fourier Transform.
We saw some very nice article about FFT in this site, but we need a real starting point, a simple program in C (something easy to compil, if possible )
With : an FFT algorithm
and : the frequency of the sound
As the project progress, we'd be happy to share with you our sources, and we'd be pleased to recieve answers and/or e-mails with anything that could help us.
Best regards,
|
|
|
|
|
Hi,
I'm creating a property sheet inside another property sheet. I have a main view, where I'm putting the main property sheet which has 6 tabs( property pages). In the first tab I'm having 2 tabs, which is having so many controls. I'm drawing the property pages and controls using SetwindowPos(). The problem is when I first open the tab, the controls are not drawn, when I switch to the next tab and come back, the controls will appear.what could be the problem. where should I draw the controls ? Now I'm calling the fnDraw() in onInitDialog() & onSetActive() function. What is wrong...any idea how to do it. Hope my question is clear.
Thanks
|
|
|
|
|
Hi,
Have you tried using Tab control inside of propertysheet?
I'm not quite sure if CProtertySheet is designed to be nested inside another one.
Regards
|
|
|
|
|
No..I have not tried Tab control.
|
|
|
|
|
hi Everybody
i planned to do soft in Borland C++
and i need to take information from Sound Card
and i've problem in finding appropriate object(component) which enables me to take info from Sound Card
please help
thanks..
|
|
|
|
|
Hi Friends,
with reference to http://www.codeproject.com/tips/CSMTPConnection2.asp link
i have a query..
I am going to implement the same but whenever i sets subject it gives exception,please help me to get rid of this problem.
Thanks in advance.
The secret of life is not enjoyment
but education through experience.
- Swami Vivekananda.
|
|
|
|
|
Did you read comments? http://www.codeproject.com/tips/CSMTPConnection2.asp?df=100&forumid=171182&select=1145121#xx1145121xx
Regards
|
|
|
|
|
Thank you very much for ur valuable HELP.
It is working fine now.
The secret of life is not enjoyment
but education through experience.
- Swami Vivekananda.
|
|
|
|
|
could please some one explain me what is this "nPage" exactly for?
thankx
Must..kill..all..humans!
|
|
|
|
|
As stated in MSDN:
nPage
Specifies the page size. A scroll bar uses this value to determine the
appropriate size of the proportional scroll box.
I think that the following excerpt of MSDN sample Example of Scrolling Text makes it clearer:
case WM_SIZE:
yClient = HIWORD (lParam);
xClient = LOWORD (lParam);
yMax = max (0, LINES + 2 - yClient/yChar);
yPos = min (yPos, yMax);
si.cbSize = sizeof(si);
si.fMask = SIF_RANGE | SIF_PAGE | SIF_POS;
si.nMin = 0;
si.nMax = yMax;
si.nPage = yClient / yChar;
si.nPos = yPos;
SetScrollInfo(hwnd, SB_VERT, &si, TRUE);
As you can see, after setting up the scroll range, you should give a clue of the VISIBLE range (your client area) so that the scroll box will have reasonable dimensions.
Hope that helps.
|
|
|
|
|
Thankx, its all clear now.
--------------------------
Must..kill..all..humans!
|
|
|
|
|
You are welcome.
|
|
|
|
|
Hi all:
I wonder how the calls into CRT library are resolved, namely the calls into msvcm80.dll msvcp80.dll and msvcr80.dll. The system will search through the environment variable? But I didn't see anything special with the %PATH%.
The problem I'm facing is that the to be released program behave differently on two XP machines. I have a startup executable (I believe it's didn't use any routines provided in those CRT libs) resides in the release root dir which just used to launch another executable in sub folder. I put those CRT libs in the previously mentioned sub folder, and the program acts normally until today. I was prompted with "The application failed to initialize properly (150002). Click OK to terminate", and when I copied those CRT libs from sub folder over to root the app start to works normally again. I figured I must done something special to the system, but I've done nothing. But how could this happen?
|
|
|
|
|
hello everyone!!!
i am working on some application. i have to deal with strings. the string may contain the ASCII characters or some other values. i need to check if the string contains ascii characters. for that purpose, i am parsing the string, taking each character at once, checking whether it lies in the ascii range and then print the string only if it has ascii characters.
i think this is the right procedure. but i am afraid that the performance is hampered when i am dealing with large number of lengthy strings. so, i wanted to know if there is any other better way. thanks in advance...
vijay.
|
|
|
|