|
Has anyone seen anything like this before?
http://www.sagara.org/menu.gif[^]
Notice the File menu (left-most). Those garbled characters are supposed to be Japanese characters. Everything in the File menu is garbled, just like that. However, everything else on the rest of the menu renders just fine. In fact, throughout the whole rest of the UI, Japanese text renders perfectly. It's just in the File menu that it doesn't work correctly. The really annoying thing is that the Japanese characters show up correctly in the resource editor.
I had the translator re-type in the text and re-saved the file, but that didn't work.
I tried pasting in the text from the Edit menu, but that didn't work, either.
I'm stumped. Any help would be appreciated.
Thanks!
(BTW, the program is written with VC6, using MFC. It runs on Windows 2000+.)
[edit]
This seems to be a positional thing. I edited the resource file so that the Edit menu came before the File menu and then recompiled. This caused the Edit menu (now the left-most menu) to be garbled, while the File menu rendered correctly.
Does this ring any bells?
[/edit]
|
|
|
|
|
I have a static text label in a straight-Win32 app I'm working on, and I'm wanting the cursor to change to a hand icon when the mouse moves over it (and back to normal when the mouse moves away). What's the best way to do that? It appears that it's possible using RegisterWndEx, but then I have to code a text control myself; there has to be a simpler way.
|
|
|
|
|
I don't know if this would be simple enough for you, but the standard way of creating 'hyperlinking' controls is :
define your own CMyStatic : public CStatic .
Now override OnNcHitTest and return HTCLIENT , this will cause windows to ask you for a cursor, otherwise it won't, e.g.:
<br />
UINT CMyStatic::OnNcHitTest(CPoint point)<br />
{<br />
return HTCLIENT;<br />
}<br />
Now override OnSetCursor and set your hand icon within it, e.g.:
<br />
BOOL CMyStatic::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)<br />
{<br />
::SetCursor(LoadCursor(NULL, IDC_HAND));<br />
return TRUE;<br />
}<br />
That's it.
|
|
|
|
|
Thanks, that worked; I didn't even need to implement the NCHITTEST message in my WndMainProc .
|
|
|
|
|
i just copmiled those lines
<br />
......<br />
CClientDC dc(this);<br />
OnPrepareDC(&dc);<br />
dc.SetPixel( point, RGB(0, 0, 0,) );<br />
......<br />
what i've got is:
---------------------- Done ----------------------
Build: 1 succeeded, 0 failed, 0 skipped
but this line contains more commaz that it needs:
dc.SetPixel( point, RGB(0, 0, 0,) );
and it works any way
do someone know why?
|
|
|
|
|
Does it run successfully in Release/Debug?
Regards,
Axe
|
|
|
|
|
RGB is a macro, so you should see what it expands to in order to see what is going on here.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
COLORREF SetPixel( int x, int y, COLORREF crColor );
COLORREF SetPixel( POINT point, COLORREF crColor );
these are the two overloaded functions of SetPixel. So your function call fits the second case and so it will work.
MSN Messenger.
prakashnadar@msn.com
Tip of the day of visual C++ IDE.
"We use it before you do! Visual C++ was developed using Visual C++"
|
|
|
|
|
I think (I'm not sure ) that the compiler will ignore everything that doesn't fit int the macro definition. So for example you can put everything you want after the last zero (if separated by a comma of course, otherwise it will be detected as a single 'variable').
So for example: this will compile:
dc.SetPixel( point, RGB(0, 0, 0, UnknowVariable) );
even if UnknowVariable is not declared.
In fact, a macro is just a way to tell the compiler to replace a portion of text by another text just before the compilation...
Hope this helps
|
|
|
|
|
Hi,
I am trying to create a single-linked list class using templates.
#ifndef CSLLIST_H_
#define CSLLIST_H_
/// HEADER FILE INCLUDES //////////////////////////////////////////////////////
#include "CSLNode.h"
/// CLASS DECLARATIONS ////////////////////////////////////////////////////////
template <class t="">
class CSLList
{
private:
CSLNode<t>* pHead;
CSLNode<t>* pTail;
public:
CSLList();
~CSLList();
bool AddDataToHead(T* pNewData);
bool AddDataToTail(T* pNewData);
bool DeleteDataFromHead(T* pDeletedData);
bool DeleteDataFromTail(T* pDeletedData);
bool IsListEmpty();
bool IsNodeInList(T* pDataToFind);
void PrintListContents();
};
#endif
When I try using the list in main using
CSLList<int> oTempList;
everything compiles but the linker fails with the following errors:
Main.obj : error LNK2001: unresolved external symbol "public: __thiscall CSLList<int>::~CSLList<int>(void)" (??1?$CSLList@H@@QAE@XZ)
Main.obj : error LNK2001: unresolved external symbol "public: __thiscall CSLList<int>::CSLList<int>(void)" (??0?$CSLList@H@@QAE@XZ)
Any ideas on what I am missing? Thanks.
|
|
|
|
|
do you have a function body for your constructor and destructor that it's getting the error on? If so, do they match? If not try this, adding a body to your constructor and destructor:
CSLList(){};
~CSLList(){};
If it's broken, I probably did it
bdiamond
|
|
|
|
|
the constructor and destructor (and all other declared methods) are implemented.
template <class T>
CSLList<T>::CSLList()
{
pHead = pTail = NULL;
}
template <class T>
CSLList<T>::~CSLList()
{
CSLNode<T>* oTmpNode;
while (pHead != NULL)
{
oTmpNode = pHead->GetNextNode();
delete pHead;
pHead = oTmpNode;
}
}
|
|
|
|
|
|
|
Hi there.
The issue I am facing is pretty different for me. Let me explain this with an example, whenever we install my application, a button was created in Internet explorer toolbar. This button is used to activate the Dialog box where I have created some controls. Now, I want to have the same sort of button on MSN Messenger, so that I can activate/invoke the same Dialog box I am using with Internet Explorer.
So, my main problem is to have a button on MSN Messenger screen and then linking that button with the code I want to call.
Thanks and Regards,
Pankaj Bhalla
pankajbhalla@mantraonline.com
|
|
|
|
|
I dont know why ppl wants to put buttons in MSN messenger, yahoo messenger and what not....
If the MSN messenger is not documented to work the way IE works(for customisability) then you cant effectively put buttons into that.
MSN Messenger.
prakashnadar@msn.com
Tip of the day of visual C++ IDE.
"We use it before you do! Visual C++ was developed using Visual C++"
|
|
|
|
|
Hi there.
So, sir you mean, by no way we can create buttons on MSN messenger. One more issue, do u know how to invoke outlook from VC++ application. I mean, i do not want to send the mail directlty, I want to have Outlook up, so that user can type in the subject and message and then can send the email.
Thanks and Regards,
Pankaj Bhalla.
Pankaj Bhalla
|
|
|
|
|
This will give you some idea Click Click[^]
MSN Messenger.
prakashnadar@msn.com
Tip of the day of visual C++ IDE.
"We use it before you do! Visual C++ was developed using Visual C++"
|
|
|
|
|
Consider the following:
string mystring[] = {"Hello","World"};
How do I find how many elements my array of has?
If for example I wanted to loop through the array and count the elements that had the letter 'L' or 'l' in them.
displaying something like:
element 1: 2
element 2: 1
My main focus here is how do I find out the number if elements in a given array.
Thanks in advance for your help.
|
|
|
|
|
sizeof( )
is your friend here.
Remember, it will give you the size of the whole array,
so you have to divide by the size of each element.
|
|
|
|
|
I know with regular arrays you would do a sizeof(mystring)/sizeof(string), but I really don't know about with string variable types.
If it's broken, I probably did it
bdiamond
|
|
|
|
|
Cool,
What about if we take it one step further and have this:
int main()
{
string mystring[] = {"ASD","asdf"};
int i;
i = myfunc(mystring[]);
cout << i;
return 1;
}
int myfunc(string mystring[])
{
int i;
i = sizeof(mystring) / sizeof(mystring[0];
return i;
}
I get two different results when using the sizeof() in myfunc and sizeof in main....
Do I need to pass a pointer to the string??
|
|
|
|
|
You must pass the array size to myfunc. Myfunc receives a string pointer (that's all an array really is, a pointer to a contiguous block of strings), and has no way of knowing the size of the array that pointer points to.
Inside the main function, the compiler substitutes the sizeof operator for the actual known size of your string array. However, inside the myfunc function, the compiler has no way to determine the size of the array passed. If you print the sizeof(mystring) in myfunc, you'll find it always equals 4, the size in bytes of a pointer (on the x86 architecture).
It would probably be better if sizeof() never worked on arrays at all. At least then it would be consistent and less likely to confuse people who've never run into this before.
|
|
|
|
|
It might be preferable to find a way to use
vector< string > mystring ;
Then mystring.size () is obviously the size...
Otherwise you could use a sentinel,
<br />
string mystring [] = { "Hello", "World", "" } ;<br />
<br />
void DoSomething ( string mystring [])<br />
{<br />
while ( !mystring->empty ())<br />
{<br />
DoSomethingWithMystring ( mystring ) ;<br />
++mystring ;<br />
}<br />
}<br />
Paul
|
|
|
|
|
I've finally made my DLL (with help that I am truly grateful for from many members of CodeProject - thanks for being patient ) .However I actually made the DLL to be called from Delphi instead of VB. I have been using VB because I know VB. But the function in the DLL accepts strings, which for VB I have used BSTR and __stdcall. Can I still use BSTR for Delphi and what about the calling convention? Thanks in advance for all your help!!!
If it's broken, I probably did it
bdiamond
|
|
|
|