|
Hi,
can someone give me some information about using Stingray Objective Grid 97 Control? I had read the documentation but it´s very bad! Or has someone a tutorial about it??
thanks
Simon
|
|
|
|
|
|
Hi out there,
I'm working an instrument based on the Windows CE operating system. The applications is now to be translated into Japanese.
I have found a true type font "MS Gothic.ttf" that supports Japanese charactes. That works fine except for titles in dialogs that use the sysytem font.
I don't want to link the font into the OS image but instead load a system font dynamically.
I have tried to modify the registry:
[HKEY_LOCAL_MACHINE\SYSTEM\GDI\SYSFNT\Nm] from Tahoma to MS Gothic
[HKEY_LOCAL_MACHINE\SYSTEM\GWE\Menu\BarFnt\Nm] from Tahoma to MS Gothic
[HKEY_LOCAL_MACHINE\SYSTEM\GWE\Menu\PopFnt\Nm] from Tahoma to MS Gothic
[HKEY_LOCAL_MACHINE\SYSTEM\GWE\OOMFnt\Nm] from Tahoma to MS Gothic
But it doesn't work.
Any ideas??
Jørgen Belfalas
|
|
|
|
|
Hello,
I have a problem with text selection. I want to get the highlighted text that users double click on it (not only in my own application). Do I have to use COleDataObject to implement this? Is this about clipboard?
I'm a beginner. Guide me, please.
|
|
|
|
|
Yes, it's about clipboard. This code places the contents of strClipboardText variable in clipboad. You'll probably use CEdit::GetSel and CEdit::GetSel and CEdit::GetWindowText to get this string.
CString strClipboardText = ...;
if (!OpenClipboard() || !EmptyClipboard())
{
AfxMessageBox("Error: can't open the clipboard.");
return;
}
HGLOBAL hglbText = GlobalAlloc(GMEM_MOVEABLE, 1 + strClipboardText.GetLength());
char *pData = (char *)GlobalLock(hglbText);
lstrcpy(pData, strClipboardText);
GlobalUnlock(hglbText);
SetClipboardData(CF_TEXT, hglbText);
CloseClipboard();
Assuming that you're using CEdit control, there will be a problem with double-clicking - this action highlights the *word* you're clicking on. Previous selection is lost. You may try to override WM_LBUTTONDBLCLK to change this behavior.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Thank you very much.
But there's a problem. I didn't get highlighted text from edit box but i want to get highlighted text from anywhere on screen (ex. in browser, spreadsheet, notepad, etc.). How can I get it? Guide me, please.
|
|
|
|
|
When a string which contains more than 260 characters is inserted in a CListCtrl only the first 260 characters are visible. The string is not truncated cause GetItemText returns the hole string. Any ideas how to show the hole string in the CListCtrl?
Ha dé
Lloyd Cole
|
|
|
|
|
Try to custom-draw the control. There should be some articles about that in the listctrl section of CP.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
hi,
I’m trying to write a plugin or anything else that will do the job to allow me to put an icon onto Internet Explorer and add some functionality to this icon.
Does anybody know how this can be done?
Cheers
Dor
|
|
|
|
|
Line for line I can't help you, but there are examples of what I think you are looking for here at CP, the greatest place on earth (virtual anyways).
Do a search for IE Toolbar.
Cheers!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
I am making a multithreaded app that connects to a serial port and already lots of people here have been a great help!
At the moment I have several threads, two in particular (which coincidentally I have put in a seperate dll) are called RxThread and TxThread, obviously controlling the transmission and receiving of data from the serial port.
What I am trying to do is have a CEvent that I can signal with the RxThread when I have received a reply from a message sent using TxThread (to serial). I know in TxThread I want to WaitForSingleObject for a little while, and if timedout check for messages to TxThread (ie WM_QUIT, not serial messages) and Retry sending (to Serial)!
The trouble is I'm not sure how to create the CEvent object so that I can set it with the RxThread each time I get a reply, and wait for it in TxThread so I can block the thread for a little while!
Thanks for any help
-Mark
|
|
|
|
|
Option 1. The RxThread and TxThread belongs to the same process:
- create unnamed CEvent object;
- create RxThread object and pass the reference to the unnamed CEvent object;
- create TxThread object and pass the reference to the unnamed CEvent object;
Option 2: The RxThread and TxThread belongs to different processes:
Both threads must create named CEvent class object with the same name.
|
|
|
|
|
How would you create and implement styles into your own custom class? Thanks for you replies in advance.
-CDuddley
|
|
|
|
|
CDuddley wrote:
styles
Styles ???
Max.
|
|
|
|
|
I'll assume you mean styles like WS_VSCROLL and such...?
Umm...well I dunno if windows reserves all 32 bits of the DWORD nStyle paramter, but you could find out pretty easy and use bit locations that weren't used or use a DOWRD StyleEx and set your own bits using bitwise OR's.
Like this overloaded version of Create
Create(CWnd* pParent, DWORD nStyle)
{
CWnd::Create(nSytle...blah);
}
For instance if bit 17 wasn't already used by CreateWindow() you could use it to specifiy SHOW/HIDE 3D borders around custom button control.
Cheers!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
How do you handle them I guess is what I was wondering. Say you have an enumeration.
enum { ID_STYLE1 = 0, ID_STYLE2 = 1, ID_STYLE3 = 2 };
How do you handle the those styles in a function with the bitwize OR and AND ops? Thanks for the inputs in advance.
-CDuddley
|
|
|
|
|
Hope this is what you are after.
Serge
class MyClass
{
public:
enum Style
{
Style1 = 1 << 0, // bit 0
Style2 = 1 << 1, // bit 1
Style3 = 1 << 2, // bit 2
// so on
};
MyClass() : m_styles(0) {}
void SetStyle(Style style) {m_styles |= style;}
void ClearStyle(Style style) {m_styles &= ~style;}
void Dump() {printf("Style = 0x%08X\n", m_styles);}
private:
unsigned int m_styles;
};
void main()
{
MyClass mc;
mc.SetStyle(MyClass::Style1);
mc.Dump();
mc.SetStyle(MyClass::Style2);
mc.Dump();
mc.SetStyle(MyClass::Style3);
mc.Dump();
mc.ClearStyle(MyClass::Style3);
mc.Dump();
mc.ClearStyle(MyClass::Style2);
mc.Dump();
mc.ClearStyle(MyClass::Style1);
mc.Dump();
}
|
|
|
|
|
#define CWS_3DBORDER 0x01 //First bit of DWORD style is now used by child window style (CWS)
m_wndChild.Create(this, WS_CHILD | WS_VISIBLE | CWS_3DBORDER);
CCustom::Create(CWnd* pParent, DWORD nStyle)
{
m_b3DBorder = nStyle & MASK;
}
CCustom::OnPaint()
{
CPaintDC dc(this);
if(m_b3DBorder)
}
You may have to give the and operation the once over
I dunno how accurate my attempt at masking bits is in the above...but you should figure it out easily. I did try and give a solid example of how I would use custom flags.
Cheers!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
I have created a control from scratch derived from CWnd.
The only problem I had was deriving from this control at first I couldn't figure out why nothing was happening after the overloadded Create function was called. I quickly figured out how t fix it, but i'm not 110% sure why?
Basically in my newly derived class I had to implement(???) each function that was implemented in the base class and call the base class version in the derived class.
Is there another way around this...?
Cheers!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
I would be puzzled too because, generally speaking, you do not have to do this. You only need to implement functions that are overridden in derived classes or those that are pure virtual (not implemented in the base class.)
Something strange is afoot at the Circle-K.
|
|
|
|
|
I can't figure it out...i've done nothing out of the ordinary...my computer is definetly screwing up though.
default paramters in one of my member functions compiled fine, but the classwizrd wouldn't locate the function...so I had to remove one default parameter and everything worked fine again.
Thanx
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Did you really have to implement every function? CWnd has an awful lot of functions.
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
Hockey,
This sounds *very* strange. Send me the files if you want - I'll check them.
Regards,
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
What are the best tools available for detecting memory leaks in MFC applications? I have tried boundschecker so far, wondered if anyone could recommend any others out there...
Also, if anyone has ever seen a system error box "Required Resource Was" (thats it!), I would love to know what it means...
Cheers
|
|
|
|
|
I like Rational Purify
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|