|
You can use of CreateFont(....DWORD fdwItalic,// italic attribute option,...) and then use of <code>SetFont for set font to your control.
|
|
|
|
|
can you please tell me how to set the font to my text..
CFont font;
font.CreateFont(16,0,0,0,FW_BOLD,TRUE,FALSE,0,ANSI_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,
DEFAULT_QUALITY,DEFAULT_PITCH | FF_SWISS,"Tahoma");
i can have my static text like GetDlgItem(IDC_STATIC10);
can you help me again please...
vikas da
|
|
|
|
|
GetDlgItem(IDC_STATIC10)->SetFont(&font);
|
|
|
|
|
Hi. This Error is make me crazy please helpme.
I dont know where ir the IID_IADsUser
Thanks
ompiling resources...
Compiling...
StdAfx.cpp
Compiling...
ADFind.cpp
D:\Erith\PROGRAMING C++\ADFind\ADFind.cpp(45) : warning C4101: 'bstrName' : unreferenced local variable
Linking...
ADFind.obj : error LNK2001: unresolved external symbol _IID_IADsUser
Debug/ADFind.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
ADFind.exe - 2 error(s), 1 warning(s)
|
|
|
|
|
Please consider the following declarations:
class base1 {<br />
public:<br />
virtual int f1() = 0;<br />
};<br />
<br />
int<br />
base1::f1()<br />
{<br />
return 1;<br />
}<br />
<br />
class dev1 : public base1 {<br />
public:<br />
int f1();<br />
};<br />
<br />
int<br />
dev1::f1()<br />
{<br />
return 2;<br />
}
Since the class base1 cannot be instantiated, is there anyway to call base1::f1()? If so, please tell me how?
Thanks
Bob
|
|
|
|
|
what about calling the base class in the derived method of f1 ?
int dev1::f1()
{
return base1::f1();
}
This signature was proudly tested on animals.
|
|
|
|
|
Thanks for the response and your response works. I just checked it. I should have thought of that myself.
Bob
|
|
|
|
|
Yes! You could call it by using the pointer of derived object. For instance,
dev1* pDerived = new dev1;
pDerived->base1::f1();
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Hi everybody...
this is my first question here,... hope someone can help me!
I have following problem: I have programmed an own file transfer protocol for a network,
but i do not check the rights for accessing directories; the groups are organized with active directory, so i need to check if the user is allowed to access the directory, which he requested.
I have never worked with active directory before, so i am a absolutely newbie!
But i am learning fast, so if someone could tell me how to get the directorie's, which the logged on user is allwowed to access i would be proud of it!
You could also also help me, by answering this question:
How can I read the yet blue database, so i could read the active directory database and check it with a own function... But mybe someone knows a better way to solve my problem,...
If you do so please answer this question!
Greetz BI0sSt@R
|
|
|
|
|
Hi folks,
I'm in a bit of a pickle here. I have been working on a dll that runs in debug and also runs in release mode when the executable is started from Visual Studio, but it causes a crash when invoked from the command prompt.
I have did my homework and read a lot of useful information on this site as well as others but failed to find the culprit.
I can go as far as dumbing down the code so much that commenting a single line makes it run. I'm using a map container.
I can also post the header file, but first I thought that someone might be able to offer some insight about map containers gotchas...
Here is the code:
typedef std::map<int,> ObjectMap;
ObjectMap s_objectMap;
CLINKAGE
DLLFUNC void STDCALL SOMEFUNCTION(int *id, int *init)
{
ObjectMap::const_iterator it = s_objectMap.find(*id);
if (*init)
{
if ( it == s_objectMap.end())
{
int ti = (int)s_objectMap.size()+1;
mbdObject *pTheObject = new mbdObject(ti, id);
}
}
}
basically if I comment out the creation of the new object the code would not do anything useful but it would run. As soon as the 'new' operator is back in. BOOM....
Any help *greatly* appreciated!
Andrea.
|
|
|
|
|
Try putting Messageboxes or writing a log in the code to see where your code gets, maybe it dies in the contructor of that object or later when the object is used.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
bingo.. it crashes in the constructor. nothing to do with maps apparently.
I'll have to take a close look. thanks for the suggestion that got me further ahead...
andrea.
|
|
|
|
|
Member 3694270 wrote: it crashes in the constructor
In that case, Check for uninitialized variables/ Garbage values. That can cause trouble in release version.
And this article will be helpful - Surviving the Release Version.[^]
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
modified on Wednesday, December 3, 2008 3:11 PM
|
|
|
|
|
I would like to change the title of the frame window created by AVI capCreateCaptureWindow function.
I have a slow video capture application and would like to see title change after each frame is processed.
So far I have been unsuccessful.
Any constructive help is as always appreciated.
Thanks for reading
Cheers
Vaclav
<div class="ForumMod">modified on Wednesday, December 3, 2008 4:51 PM</div>
|
|
|
|
|
What have you tried?
SetWindowText()/WM_SETTEXT should work if you're providing the correct HWND.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi Mark,
here is my code snippet and the error I get after the test run of SetWindowText.
As always - my text is not showing the derefference "->" correctly, but it is there!
m_hWnd = capCreateCaptureWindow(_T("Preview - AVI frame "),
WS_CHILD|WS_CLIPSIBLINGS | WS_CAPTION | WS_VISIBLE | WS_MAXIMIZE |WS_MAXIMIZEBOX |WS_MINIMIZEBOX , x, y, 100,200,
pParentWnd?pParentWnd->GetSafeHwnd():NULL, 0xffff);
VERIFY(m_hWnd);
m_hWnd->SetWindowText(_T("Ready for AVI frame "));
error C2039: 'SetWindowTextA' : is not a member of 'HWND__'
|
|
|
|
|
m_hWnd is an HWND, not a CWnd*.
You can call the Win32 API directly:
::SetWindowText(m_hWnd, _T("Ready for AVI frame "));
or wrap the HWND in a CWnd object and use CWnd methods:
CWnd vcapwnd;
vcapwnd.Attach(m_hWnd);
vcapwnd.SetWindowText(_T("Ready for AVI frame "));
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks Mark, appreciate you putting up with my stupid mistakes.
Vaclav
|
|
|
|
|
The following string encoded in UTF8
"s in €" appears in ascii as "s in €"
after a call to MutiByteToWideChar
int nSize = MultiByteToWideChar(CP_UTF8,0,pstrValue,-1,NULL,0);
if ( nSize == 0 )
return;
WCHAR * pBuffer= new WCHAR[nSize];
MultiByteToWideChar(CP_UTF8,0,pstrValue,-1,pBuffer,nSize);
unfortunately instead of the Euro sign, I get the character #26
Any idea?
Thanks
|
|
|
|
|
Do you check the utf8 values in pstrValue are correct?
Correct utf8 value for Euro sign is "0xe2, 0x82, 0xac".
Also, if you check the pBuffer using C runtime function like printf, you should set locale properly before calling printf through setlocale function.
I test your code but it runs correctly.
|
|
|
|
|
Hello !
I've written a custom dll to allow users to launch a little proggy that can unlock their password.
This is working pretty good except when I want to log remotely on a workstation where the gina.dll has been installed with Terminal Services.
Does anyone know what informations I have to initialize so that it'll work or point me to an example ?
I'm clueless on what to do...
Thanks a lot !
Narf
|
|
|
|
|
I switched to using WLX_VERSION_1_4 and I tried to get a pointer on the WlxQueryTerminalServicesData and WlxQueryTsLogonCredentials functions but GetProcAddress tells me these 2 doesn't exist in msgina.dll.
They don't have any aliases when I look at them through the Dependency Walker.
Anyone ?
|
|
|
|
|
Hello all,
I am having some issues with a few of my projects at work here. I have one which is a service using the afx dll and one which is a mfc project and also includes the afx dll. The reason I am pointing out that the afx dll is included is that I have a project which does not use stdafx.dll or #define _AFXDLL and it still compiles fine.
The weird thing is it worked on Wednesday before the Thanksgiving vacation. I even have an installer that I had created. When I got back to work on Monday, it gives me these 13 errors:
from zmouse.h:
Error 1 error C2146: syntax error : missing ';' before identifier 'HwndMSWheel'
Error 2 error C2433: 'HWND' : 'inline' not permitted on data declarations
Error 3 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
Error 4 error C2065: 'PUINT' : undeclared identifier
Error 5 error C2146: syntax error : missing ')' before identifier 'puiMsh_MsgMouseWheel'
Error 6 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
Error 7 error C2059: syntax error : ')'
Error 8 error C2143: syntax error : missing ';' before '{'
Error 9 error C2447: '{' : missing function header (old-style formal list?)
from prsht.h:
Error 10 error C2065: 'CALLBACK' : undeclared identifier
Error 11 error C2065: 'LPFNPSPCALLBACKA' : undeclared identifier
Error 12 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
Error 13 fatal error C1903: unable to recover from previous error(s); stopping compilation
I even rebuilt my service from scratch, just copy and pasting code into the new project from my old project. That did not work.
Like I said before, it worked on Wednesday, I did not touch it for four days, and on Monday I tried to compile it and it would not work. It has the same exact errors no matter which settings I choose in my project settings, or which order my includes are in. I am really at a loss here, and was wondering if anyone else has ran across this.
I redownloaded and reinstalled the Windows SDK. No worky.
I have tried to research this extensively but the only advice I see is to include windows.h before zmouse. I am not actively including zmouse, however, so I am not sure why it is erroring.
Here is my stdafx.h:
#pragma once
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#define _AFXDLL
#include afxsock.h
#include stdio.h
#include tchar.h
#include winsock2.h
#include ws2tcpip.h
It is a pretty basic project which just uses a 3rd party SDK to connect to and control a telephone PBX. I need the socket classes in there to communicate with one of the companies servers.
Here is the stdafx.h from my other project (uses a SDK to create a video viewer that connects to a DVR out in the field). This project was one I inherited from another developer, then modified it when the clients wanted something added. This one compiled fine as well, until this Thanksgiving weekend.
#pragma once
#define WM_MYTHREADMESSAGE (WM_USER+1)
#ifndef _SECURE_ATL
#define _SECURE_ATL 1
#endif
#ifndef VC_EXTRALEAN
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#endif
#ifndef WINVER // Allow use of features specific to Windows XP or later.
#define WINVER 0x0501 // Change this to the appropriate value to target other versions of Windows.
#endif
#ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later.
#define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target other versions of Windows.
#endif
#ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later.
#define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later.
#endif
#ifndef _WIN32_IE // Allow use of features specific to IE 6.0 or later.
#define _WIN32_IE 0x0600 // Change this to the appropriate value to target other versions of IE.
#endif
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit
#define _AFX_ALL_WARNINGS
#include afxwin.h
#include afxext.h
#include afxdisp.h
#ifndef _AFX_NO_OLE_SUPPORT
#include afxdtctl.h
#endif
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include afxcmn.h
#endif // _AFX_NO_AFXCMN_SUPPORT
I would greatly appreciate any help on this and any more information you may need I will be glad to post.
I am using Visual Studio 2008
Windows XP Service pack 3
.NET Framework 3.5
Windows SDK 2008 for XP SP 2
The only thing I can think is that this weekend my computer downloaded an update when I was sleeping... but I have also researched that extensively and could find nothing on it.
EDIT: I had to take the greater and less than's off my includes so they would show. That is *NOT* a syntax error.
|
|
|
|
|
No one has ran across this before or has any advice?
I have tried all the settings in my linker, and C++ tabs in my project properties, I have tried rearranging the order of my includes (read this from another site) as well as redownloading and reinstalling the Windows SDK. I am about to reinstall Visual Studio 2008.
Any help at all would be appreciated!
|
|
|
|
|
I have a problem where I wish to receive broadcast UDP using call recvfrom, it just sits on the call waiting, although the packets are arriving as I can see in Wireshark.
In the scenario, I have a virtual machine which provides the broadcast packets on UDP port 3000, which are being received on the host machine through the loopback adapter. As a starting point, I’ve used the example code from the MSDN Library entry for recvfrom and changed the port value to 3000, and used setsockopt to set SO_BROADCAST to true.
Using netstat, I can see an active connection on my process for 0.0.0.0:3000.
Where am I going wrong?
Any help appreciated
david
EDIT: im kind of thinking its something to do with it coming from a virtual machine over a loopback adapter???
And by the way, its on Vista64 using Visual Studio 2005
modified on Wednesday, December 3, 2008 11:35 AM
|
|
|
|