|
How can I change the fonts of edit box.
Thanks to all.
|
|
|
|
|
Create a member variable( of control type ) for the edit control and call the SetFont funtion of that variable.
nave
|
|
|
|
|
<br />
CFont m_Font;<br />
m_Font.CreateFont(...);<br />
m_EditBox.SetFont(&m_Font);<br />
whitesky
|
|
|
|
|
But It is Giving Debug Assertion Failed..
-----------------------------------
CFont font;
font.CreateFont(
12, // nHeight
0, // nWidth
0, // nEscapement
0, // nOrientation
FW_NORMAL, // nWeight
FALSE, // bItalic
FALSE, // bUnderline
0, // cStrikeOut
ANSI_CHARSET, // nCharSet
OUT_DEFAULT_PRECIS, // nOutPrecision
CLIP_DEFAULT_PRECIS, // nClipPrecision
DEFAULT_QUALITY, // nQuality
DEFAULT_PITCH | FF_SWISS, // nPitchAndFamily
"Arial"); // lpszFacename
m_Edit.SetFont(&font);// where m_Edit is: CEdit m_edit;
----------------------------------
|
|
|
|
|
|
It is Giving Debug Assertion Failed..
NO Error. Assertion Failed.... for the line m_Edit.SetFont(...
Where have to give this code " m_Edit.SetFont(... "
|
|
|
|
|
I dont know your error use from debugger but i write and i check this code not problem and it work
please see,
<br />
CEdit m_Edit2;<br />
CFont font;<br />
<pre>
m_Edit2.Create(WS_CHILD|WS_VISIBLE,CRect(100,0,250,23),this,1);
font.CreateFont(
12,
0,
0,
0,
FW_NORMAL,
FALSE,
FALSE,
0,
ANSI_CHARSET,
OUT_DEFAULT_PRECIS,
CLIP_DEFAULT_PRECIS,
DEFAULT_QUALITY,
DEFAULT_PITCH | FF_SWISS,
_T("Arial"));
m_Edit2.SetFont(&font);
</pre><br />
test this code and answer to me it has error or it work <br />
<br />
<font size="2" color="#99ff66"><hr></font><div style="padding: 2px; text-align: left; color: rgba(255, 255, 255, 1); width: 80px"><font size="2" color="#99ff66">whitesky<br />
</font></div><hr>
|
|
|
|
|
Yes the code is working;
Thanks a lot.
|
|
|
|
|
|
how to change the background color of menu bar ?
THX
|
|
|
|
|
|
Or easier, without the need to ownerdraw:
MENUINFO mi;
memset(&mi, 0, sizeof(mi));
mi.cbSize = sizeof(mi);
mi.hbrBack = hBrush;
mi.fMask = MIM_BACKGROUND;
SetMenuInfo(hMenu, &mi);
|
|
|
|
|
<A
href="http://www.somesite.com/sth.asp" target=_blank>
<img height=100 src="see.jpg" width=600 border=0>
</A>
the html code above show a picture with a link.
How could I filter the img without change the link?
I tried Name Space,I can only show a white area with the link.
I tried Mime Filter,I can only replace some text with some other text.
What I want to do is to replace the IMG with a CString such as "killbill" with the original link. AND also,the HTML code shouldn't change.
How could I do so? thank you.
|
|
|
|
|
Hey, I am trying to send an integer from a VB 6.0 application to a VC++ 6.0 DLL. I know how to send strings, but still having trouble getting numbers to take.
I represent the incoming data as an u_int, I interpret the return as a long, and I send the data as an Integer.
VC++ 6.0 Side:
int _stdcall test(u_int test1, u_int test2, u_int test3)
{
return 0;
}
VB 6.0 Side:
Public Declare Function test Lib "MyDll.dll" (ByVal test1 As Long, _
ByVal test2 As Long, _
ByVal test3 As Long) as long
Call test(1,100,25)
The initial setup crashes the application. So, I just need help sending numeric values to my dll, so that i can interpret them as u_int and use their values in my code. So, if I send the number 100, I need that number to go to my dll and be defined as 100, so that I can use that number in my code, within the function.
need more info? let me know, all help is appreciated, thanks in advance
salut
|
|
|
|
|
I'm not a big fan of COM but this is one of those instances where you'll find setting up a COM interface in the dll greatly simplifies interactions with VB 6.0.
|
|
|
|
|
not a big fan either. It causes a GPF because I am sending the wrong variable type. What is the vb equivalent to u_int. I thought long. It shouldn't be that hard to send an numeric value from VB 6.0 to a VC++ DLL, I am sure there is an easier way, any one? thanks anyway and thanks to those to come in advance.
Salut
|
|
|
|
|
I don't believe there is one. VB has no concept of unsigned integers.
Anna
Currently working mostly on: Visual Lint
Anna's Place | Tears and Laughter
"Be yourself - not what others think you should be"
- Marcia Graesch
"Anna's just a sexy-looking lesbian tart"
- A friend, trying to wind me up. It didn't work.
|
|
|
|
|
hmm, you would think long would work. I suppose I should define my vars on the C++ side, as something more VB compliant. I think I have this one solved, in a generic way. Perhaps, some suggestions? tia
salut
|
|
|
|
|
borono wrote: all help is appreciated
VB6 Doesn't know Unsigned integers, just use the long type (both VB & VC).
borono wrote: I need that number to go to my dll and be defined as 100
In that case what is wrong with just using a plain integer (this one I know works, I have used this method)?
Public Declare Function test Lib "MyDll.dll" (ByVal test1 As Integer,<br> _ ByVal test2 As Integer,<br> _ ByVal test3 As Integer) as Integer
int _stdcall test(int test1, int test2, int test3) {
If your returning 0, why return anything at all? Returning void will work, change your vb declare from a Function type to a Sub type.
I'd love to help, but unfortunatley I have prior commitments monitoring the length of my grass. :Andrew Bleakley:
|
|
|
|
|
Hi everyone,
Is it possible to access protected function of one class from another class? can anyone please give me a suggestion for this?
Thanks in advance.
Regards,
Ram
|
|
|
|
|
|
I recently ran into a problem related to the topic, was wondering if anyone has any ideas...
The setup:
<br />
class CView<br />
{<br />
friend class CPreviewView;<br />
<br />
protected:<br />
BOOL DoSomething();<br />
};<br />
<br />
class CPreviewView : public CView<br />
{<br />
public:<br />
void SetSomething(CView* pView)<br />
{<br />
...<br />
<br />
pView->DoSomething();<br />
<br />
...<br />
}<br />
};<br />
<br />
class CMyPreviewView : public CPreviewView<br />
{<br />
public:<br />
void SetSomething(CView* pView)<br />
{<br />
<br />
...<br />
<br />
pView->DoSomething();<br />
<br />
...<br />
}<br />
};<br />
CPreviewView is granted access to DoSomething since it's declared as a friend in the CView class. In the CMyPreviewView class, access is denied to DoSomething since CMyPreviewView isn't declared as a friend.
a) If these were my own classes, I could simply add a new friend class statement to CView. Both CView and CPreviewView are MFC classes, and I don't want to touch the MFC code.
b) If the DoSomething function were virtual, I could simply add an override to CMyPreviewView.
* scratch that *
Is there a simple way that I can somehow grant CMyPreviewView public access to CView::DoSomething?
-- modified at 23:44 Tuesday 27th June, 2006
|
|
|
|
|
Hi,
This is a very basic question. Don't mind...
I want to append a blank space at the end of a string.
strcat(name, " "); doesnt seem to work. The trailing space is ignored. How can I retain it?
|
|
|
|
|
how is name declared ?
maybe the space is added after the '\0' ?
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
I don't think so...
say name contains "Mickey"
strcat(name, " "); returns "Mickey" but strcat(name, "Mouse"); returns "MickeyMouse"...
so I don't think the '\0' in name has an influence...
|
|
|
|
|