|
Hi,
I'm trying to setup Bluetooth communication between my PC and another bluetooth device.
The problem is that i don't want to do this from the bluetooth manager - i want to this directly from my application.
I tryed to use WSALookUpServiceBegin(),
WSALookUpServiceNext(),WSALookUpServiceEnd() but i allways get 3 "unresolved external simbol" Errors(yes,i've imported "ws2_32.lib" and included "winsock2.h" but it still refuse to work).
please,help me........
Regards,
Eli
|
|
|
|
|
Hello,
This question regards localization of an mfc application.
I create a base project from the MFC wizard in either Visual C++ 6.0 or .Net. On the 2nd page of the wizard I am asked what language I would like my resources to be in. I select Korean( For version 6.0 Korean must be added manually as it is not a default entry). I click Next to the remaining pages constructing a Multiple Document Interface (MDI).
I execute the application and see all the menu resources in Korean characters which is what I want. When I click on the About box of the sample application I have created, the dialog appears with ?? marks where the Korean characters should be displayed.
I understand in the resource editor of Visual C++ that it is limited to ascii characters and therefore I cannot view any of the korean characters from within the resource editor.
I am compiling the project with the default option of _MBCS ( Multi byte character set).
If I convert this preprocessor option to _UNICODE, the menus and the dialog resources are both displayed in korean. The problem is I need it to work with _MBCS.
I don't understand why the application when using _MBCS can display menus correctly (ie. in Korean characters) but displays dialog resources such as Text labels and buttons with question marks. It is as though it has only been half implemented.
I really need to be able to get the project to display using the _MBCS preprocessor as I will eventually need to display Korean characters in a large project and do not wish to convert it to unicode.(big job).
I have changed the font of the dialog to various fonts such as Gulim ( Korean supported font) also the virtual font 'Ms Shell Dlg 2'.
Thank you to everyone who can explaing to me what I am doing wrong or missing as to why a standard run of the mill MFC Wizard application only displays Korean characters in all the menu's but not in Dialog's or Frame resources.
Thank you very much
Virtualweb
|
|
|
|
|
hi all,
I want to create Barchart to show the Arriaval Time of the Employee.
Employee names are in the Y axis and employee time in the X axis..
This is should be diamically changing the time and the no of Employees..
So how do I create such a Barchart Graph using MFC/C++?
If anyone know this,please help me...send me a reply
Thanks in advance
|
|
|
|
|
Are you using the Microsoft Chart Control?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
hi,
I already try to use Microsoft Chart for my purpose.But I can not set Employee name for Y axis when using Mirosoft chart.We can set Employee name for X axis only and values for Y axis.
That's why ,for my purpose Microsoft chart is not regular..
Do u know how to set Names for Y Axis instead of X axis?
Do u know any other way to create perfect Charts?
|
|
|
|
|
well....i have created a dialog based program where i have derived class(CMyclass) from the base class CStatic class.....and i have put in the message WM_SETCURSOR.....and even used the following code....
HICON hIcon = AfxGetApp()->LoadCursor( IDC_CURSOR1 );<br />
SetCursor( hIcon );<br />
return TRUE; <br />
but the there is no change in the cursor when it reaches this derived static control window.....
can anyone give me a hand!!!!!
|
|
|
|
|
rateep wrote:
HICON hIcon = AfxGetApp()->LoadCursor( IDC_CURSOR1 );
SetCursor( hIcon );
return TRUE;
HICON in Place of HCURSOR,any it doen't matter as both are handle of 32Bit Long.
any way i think i have to chekc the code can i see some of your coding
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
ok....tis a long story.....here goes......
u c.....the code.....
HICON hIcon = AfxGetApp()->LoadCursor( IDC_CURSOR1 );<br />
SetCursor( hIcon );<br />
return TRUE;
is a working code coz i have put this in my Dialog based application (Xyz) in a class called CXyzDlg..... that is, i have already added this function "OnSetCursor()".....and the cursor changes......in the main Dlg box but..... i have derived a class from the CStatic Class named it as "CMyClass".....and i have created obcts of it in the CXyzDlg class.....basically these objects i have created by placing the "static control" on the dialog box and then..... thru the class wizard created an object linking it with the picture control of type CMyClass(that is .....SUBCLASSING).....
also in thiz CMyClass i have added the "OnSetCursor()" function as well......and many other mouse functions like "OnMouseMove()","LbuttonDown()".....etc.....but here when i put in the same code as i had put in the main Dlg box for the "OnsetCursor()".....it does not change!!!!!......y???
heres the code......that i have put in the derived class CMyClass......
<br />
#include "stdafx.h"<br />
#include "creamz.h"<br />
#include "MyClass.h"<br />
<br />
#ifdef _DEBUG<br />
#define new DEBUG_NEW<br />
#undef THIS_FILE<br />
static char THIS_FILE[] = __FILE__;<br />
#endif<br />
<br />
<br />
CMyClass::CMyClass()<br />
{<br />
m_DragOn1=FALSE;<br />
m_pot1=0;<br />
m_update=TRUE;<br />
}<br />
<br />
CMyClass::~CMyClass()<br />
{<br />
}<br />
<br />
<br />
BEGIN_MESSAGE_MAP(CMyClass, CStatic)<br />
ON_WM_LBUTTONDOWN()<br />
ON_WM_LBUTTONUP()<br />
ON_WM_MOUSEMOVE()<br />
ON_WM_SETCURSOR()<br />
END_MESSAGE_MAP()<br />
<br />
<br />
void CMyClass::OnLButtonDown(UINT nFlags, CPoint point) <br />
{<br />
<br />
HICON hIcon = AfxGetApp()->LoadCursor( IDC_CURSOR2 );<br />
SetCursor( hIcon );<br />
m_DragOn1=TRUE;<br />
<br />
<br />
CStatic::OnLButtonDown(nFlags, point);<br />
}<br />
<br />
void CMyClass::OnLButtonUp(UINT nFlags, CPoint point) <br />
{<br />
<br />
HICON hIcon = AfxGetApp()->LoadCursor( IDC_CURSOR1 );<br />
SetCursor( hIcon );<br />
m_DragOn1=FALSE;<br />
<br />
<br />
CStatic::OnLButtonUp(nFlags, point);<br />
}<br />
<br />
void CMyClass::OnMouseMove(UINT nFlags, CPoint point) <br />
{<br />
<br />
<br />
if(m_DragOn1==TRUE)<br />
{<br />
<br />
if(m_pot1<62)<br />
m_pot1+=1;<br />
else<br />
m_pot1=0;<br />
<br />
if(m_pot1%2==0)<br />
m_update=TRUE;<br />
<br />
}
<br />
<br />
<br />
<br />
CStatic::OnMouseMove(nFlags, point);<br />
}<br />
<br />
BOOL CMyClass::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message) <br />
{<br />
<br />
if(m_DragOn1==FALSE)<br />
{<br />
<br />
<br />
HICON hIcon = AfxGetApp()->LoadCursor( IDC_CURSOR1 );<br />
SetCursor( hIcon );<br />
}<br />
else<br />
{<br />
HICON hIcon = AfxGetApp()->LoadCursor( IDC_CURSOR2 );<br />
SetCursor( hIcon );<br />
} <br />
<br />
<br />
return TRUE;<br />
<br />
<br />
}
plz help me out......
thanx in advance.....and thanx for ur intrest!!!!!
|
|
|
|
|
I'm actually working with MFC for a long time..
But I've still been thinking I have so many things to study about MFC..
furthermore,, I wanna reorganize my MFC knowledge.
How can I restart again?
Which part of framework is the most significant in MFC do you think?
I've just digging into source code about MFC Message Map framework...
Is that good choice..
How can i make feel so satisfied about MFC, then can say I'm so perfect MFC programmer?
Thanks in advance...
|
|
|
|
|
(1) Doc/View shows to many tradeoffs. If your project does not fit the proposed model exactly, forget it, don't use it.
(I wouldn't go as far as to say it is seriously hosed, but only because I'm feeling nice and cheery today.)
(2) Learn Win32 API (I think this is still a valuable trait). Win32 is a fairly flat interface (99% of the time you will use 1% of the API), so the basics are easy to understand. don't bother with window creation to much, it's a bit trickier than the rest.
(3) See how MFC "wraps" this - e.g. how CWnd relates to a HWND (If you ask me, they should have used smart pointers[^] )
(4) Write a Doc/View Framework that is really usable! (evil snicker)
we are here to help each other get through this thing, whatever it is Vonnegut jr. boost your code || Fold With Us! || sighist | doxygen
|
|
|
|
|
You are a brave person, I am satisfied by the thread posted by you, because i was thinking i am the only one with same problems.
I am using VC (MFC) for one year, while remaining away from its internal details. I think that MFC is a kind of thing that no body in the universe knows all (may be), and it also requires a kind of U turns (smaller or larger) again and again, i.e. going back and learning/reading again is always needed.
After doing some larger projects in MFC I am also thinking now a days to study Message Maps (surprisingly same as you) in detail, because it is the main thing in event driven programming, but going into the deepest details code/implementation upto WINMAIN is impossible for me at this stage that is too difficult for me.
Satisfaction/Recognition. I think if we do a project successfully in MFC, then it is automatically a satisfaction/recognition for the extent of MFC used in project.
Which part of framework is the most significant in MFC do you think?
I think you have choosen right one.
Question?
People often say to study windows programming before or along with MFC,
and recommend books such as "windows programming by petzold"
1. Is it necessary to study windows programming before or along with MFC,why yes, why not ?
2. If yes then please tell the above book is good one or not (I haven't seen it) please recommend some good books/ resources?
Thanks in Advance.
|
|
|
|
|
I also have troubles on study VC++, but frankly speaking. My programming study was begin with MFC, when I just familar with the basic of C++, my elder classmate who are good at programming told me--"you can just look the chapter MFC, and jump over the windows API." I don't know why. but I really found it's useful, I used very little time and make out a project about communication. I was so exciting. but then I was stoped studying, I fell it's hard for me to improved my programming skills, my base was not solid, so I have meet many troubles on the further studying of programming.
Then I come back to study API and do some simple projects. maybe it's useless but it's useful for further studying, especial used with MFC, so I think the one who wanna study VC++ programming can started with MFC and then come back to study API,haha..
I never heared about the books named "windows programming by petzold".
--==There is No Poverty Like Poverty of Spirit!==--
|
|
|
|
|
dada_buley wrote:
I never heared about the books named "windows programming by petzold".
You have never heard of the one book on programming Windows that every experinced Windows programmer has reccommend as a must have book, since it first came out. MFC is a frame work to simplify the creation of user interfaces and that is about all it is. To fully understand what the frame work is doing you need to have a fairly good understanding of the API and that is where this book comes in. In many ways MFC makes it easy to create an application with very little understanding of whats going on, but when things do go wrong (and they will), having an understanding of the API and how it works becomes essential.
By the way MFC is not the only frame work for programming Windows, it is just the one that the majority of Windows programmers use.
INTP
|
|
|
|
|
Alright...
I'm just happy about your opinions..
pc_dev wrote:
I think that MFC is a kind of thing that no body in the universe knows all (may be)
That's exactly what I'm thinking..
But MFC teams might knows all of them, I suppose
Anyway, I'm gonna study over and over again.. if I can
Thanks. all..
|
|
|
|
|
MFC Internals by Shepherd Wingo...
That and look at the source code...
By the way the MFC 7.1 IS better...
.............................
There's nothing like the sound of incoming rifle and mortar rounds to cure the blues. No matter how down you are, you take an active and immediate interest in life.
Fiat justitia, et ruat cælum
|
|
|
|
|
Is there a way to get notified about system shutdown or restart?
In which way will an application be terminated when shutting down?
|
|
|
|
|
There are two Way for Knowing System is Shutting Down
First Easy Way
When ever system shutdown ,it send WM_QUERYENDSESSION all opened Application notifying system is shuting down.
Second Little tough way
Write a WinLogon Notification package,that will notify you about System Shutdown and much more.
you can Find a Very Good article on CP MFC/C++ /SYSTEM section over Winlogon DLL
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
WM_QUERYENDSESSION seems perfectly fitting for me.
Thanks, Alok
|
|
|
|
|
Is there a way to trap certain keystrokes from an application, even though its window does not have the focus?
My goal is to make an application almost totally invisible (except in Windows Task Manager), i.e. the main window is hidden, task bar button removed, Alt-Tab does not show it - but somehow I have to activate it from time to time, i.e. I need a kind of shortcut.
|
|
|
|
|
Let i take your goal one by one.
Vancouver wrote:
My goal is to make an application almost totally invisible (except in Windows Task Manager)i.e. the main window is hidden, task bar button removed, Alt-Tab does not show it
Make a Dialog Box application with WS_EX_TOOLWINDOW Style (that remove button from taskbar and doesn't respond to ALT+tab message)
and Start your window in hidden mode.
Vancouver wrote:
but somehow I have to activate it from time to time, i.e. I need a kind of shortcut.
u can use HOTKEY for that when ever a special key combination occur activate the window (look for RegisterHotKey api in MSDN)
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Making the window invisible was not a problem, but thanks anyway. Btw, you don't need WS_EX_TOOLWINDOW while the window is hidden, for the task bar button disappears, and the application does not come up with Alt-Tab (even the task manager does not show it as an application, only as a process). However, you need WS_EX_TOOLWINDOW if you want the task bar button disappear, etc. even while the window has the focus.
Re HOTKEY: this gave me the hint, and I looked for it (earlier I was looking for "shortcut" and did not find anything useful).
I found an alternative solution too: WM_SETHOTKEY. I will evaluate, which way is better for the particular situation.
Thanks, Alok.
|
|
|
|
|
Yeah , may be interpreted your problem Wrong.
Sorry and Thanks
By the Way the Name is 'ALOK' not Alek
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
I created a Windows Form, and would like to use it as a template. How can I do this. If I save it under a new name funny thing happen. I am using Visual Studio 6. I setup a project using C++ and Windows Forms.
|
|
|
|
|
Hi,
I have implemented a game that adds nodes to a list; in essense it is creating a tree. When I add a node to the tree, I use malloc to create memory for the node and push it onto a stack. I then pop it from the stack and do a check. If the check passes I push it back onto the stack, if it fails, I want to delete the node so I use free() to free the memory that was created for it. What is happening when you look at the Task Manger in Windows (XP), it shows the memory being allocated and freed for the application, but when you look at the field called "Commit Charge" within Task Manager, it shows a constant rise in the amount of virtual memeory being used. This continues to grow until the program ends with a memory allocation error. My question relates to resources/links/recommendations on how to better handle memory within a C++ program. I am using Microsoft VC++, version 6.0. I've looked through the code for memory leaks, but it it appears to do as it should; allocating and releasing memory in the proper order. Since it appears that memory leaks is the cause, I am looking for links or recommendations on how to find these leaks.
Any recommendations or resources would be greatly appreciated.
Thanks in advance.
Martin
|
|
|
|
|
My first question would be why are you not using the new and delete operators?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|