|
|
Hello dear friends,
Is there any API for changing the "Language support for non-Unicode language"? This is required because I've to add Russian language support in my application.I've created a string table in which I copy/paste the russian strings from excel.The problem is all characters become ???.
When I go to Control Panel->Regional and Language options->Advance tab and changing the language to Russian solves the problem and all the strings of russian displayed without any problem but this changes require to reboot the PC.I want to set this options from the API's so is there any API for this thing or any other way to do this?
Thanks in advance.
ritz1234
|
|
|
|
|
how can create data base in vc++6 (programatically)
CDBAccess *pdba;
pdba = new CDBAccess;
pdba->m_sFilePath = "";
pdba->NewDBFile();
this code is not working
error is
error C2039: 'NewDBFile' : is not a member of 'CDBAccess'
|
|
|
|
|
ani_ikram wrote: : 'NewDBFile' : is not a member of 'CDBAccess'
Is NewDBFile defined in CDBAccess?
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
NewDBFile is not member of CDBAccess
but i want to create database using vc++6
how can create
|
|
|
|
|
Then how come you try to access that member function. You would need to write your own version of NewDBAccess
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Hi all
I am trying to debug a service and this happens, my output are Connector.exe <-the service, ConnectorTray.exe <- the gui and ConnectorCpl. There are 3 different projects for this. What does this mean? What should I do?
An exception occurred while trying to run "Shell32.dll,Control_RunDLL ConnectorCpl.cpl"
Thanks,
Jayjay
|
|
|
|
|
i have i library UBA.lib in my project. i have set project settings (link) as
c:\dxsdk\lib\ddraw.lib c:\dxsdk\lib\dxguid.lib vfw32.lib winmm.lib "C:\Nova_Svep2\Common Classes\UBA.lib"
still this error ,what can be reason and how can solve this error
LINK : fatal error LNK1104: cannot open file "C:\Nova_Svep2\Common Classes\UBA.lib"
|
|
|
|
|
Add only UBA.lib and add Directory path to Tool->Options->Directroies->Library Files
May be this zcan help you.
-@SuDhIrKuMaR@-
|
|
|
|
|
Hi,
In my application I can dynamically create a menu at the top of my window and also dynamically remove it. After I created it, calling "GetClientRect" returns the correct client area (previous area-area occupied by the menu bar). Now when I remove the menu bar, the client area is not updated. Only if I resize the window or move the window will the value returned by "GetClientRect" be updated correctly. How come? Is there a workaround?
BTW I remove my menu bar with following code:
[source]
CMenu* it=GetMenu();
if (it!=NULL)
{
int nb=it->GetMenuItemCount();
for (int i=0;i<nb;i++)>
it->RemoveMenu(0,MF_BYPOSITION);
DestroyMenu(it->m_hMenu);
}
[/source]
Or is there a windows function I can call to force a similar behaviour like when resizing the window?
Thanks
|
|
|
|
|
Hi everyone,
I have a question that may sound a bit strange: What's the most efficient and elegant way to define constants in C++?
I'm in a situation where I have to define constants that might be used in code that needs to be as fast as possible (such as maybe image or sound processing for example). I know the standard way in C++ is like this:
const float myConst;
const float myConst = 3.5;
Based on my understanding, the initialization must be performed in myFile.cpp since only int constants can be initialized in the header.
The problem is that this looks a lot like the constant won't be inlined but always read from memory (or processor cache of course) when it is accessed. What's worse is that client code will most likely use myFile as part of a DLL/SO, so even if there were the slightest chance that the linker were trained to perform some magic inlining when linking the binary, I'd still be out of luck. Apart from that I need a portable solution that works reliably on Windows, Linux, Mac OS X, and if possible also on SGI Irix, independent of the compiler and linker.
The obvious solution is to just use #define myConst 3.5 , but I'd like to avoid that if possible (for obvious reasons).
If I'm right about no inlining being performed, does anyone have any proven workaround for this? All I could come up with was maybe abusing inline functions roughly like so (not tested, just an idea):
#define INLINE_CONST( TYPE, NAME, VALUE ) \
struct FastConst_T_##NAME { \
inline operator TYPE { return (VALUE); } \
} NAME
which then could be used like that:
INLINE_CONST( double, pi, 3.141592653589793238462 );
inline double circleArea( radius ) {
return r * r * pi;
}
But that's obviously not a very elegant solution. I'm really sorry for the lengthy post, but I can't believe I have to use such hacks to get C++ to inline my constant values. I already tried Google, but I didn't find anything useful.
Thanks in advance,
Peter
|
|
|
|
|
If it weren't for the doubles, I'd say use enum. It is definitely inline, and it has scope.
Otherwise, you could probably use an inline function:
double MyConstFunc() { return 3.5; }
It should be inline, and you write it inside the header. I don't know how it would work with dlls though.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
Thanks for your reply. Inline functions are not a problem with DLLs since the implementation has to be inside the header files, which means that the source code is available and can be inlined by the compiler, so no problem there.
The solution you are proposing is exactly what the macro from my post would do (the macro would just add the benefit that it is transparent to client code because it would provide the semantics of a regular const). But I found it hard to believe that C++ offers no built-in solution. I mean, the standard allows inlining of functions, but it doesn't seem to be able to inline constants. Well, I guess I'll just have to bite the bullet and live with it then.
Thanks again,
Peter
|
|
|
|
|
Hi,
I am working on a search engine project.
If any one has C++/VC++ sample code for interacting with IFilter to create indexes for list of PDF file, please share with me.
I searched the net but unable to find any thin on C++/VC++.
Thanks in advance.
Regards,
Ramachandraraju KK
|
|
|
|
|
Hello,
I am trying to concatenate several icons from an apps' resource file into a larger (wider only icon), that I can use to display on the statusbar with:
SendMessage(hWnd,SB_SETICON,0,(LPARAM)hIcon)
The icons are located in the app's resource file and are loaded hIcon1, etc... hIcon7. All icons are 16 x 16 (in color).
Based on some changeable preferences the icons being concatenate may be 1,3,4 or 1,2,5,6 etc.
I am looking for a routine that will concatenate 2 icons passed in and return a handle to a new icon on exit that has the two concatentated. Calling this several times will satisfy what I am trying to do. I would appreciate any assistance in this area since I am not a bitblt or dc guru and have know idea on how to get this to work, win32 c++ only.
Thanks,
|
|
|
|
|
I am sorry to keep asking questions abut this, but:
HDC dc; HBITMAP bm;
----- set up the bitmap; I now know how to do this, I think -----
Please how do I link the device context to the bitmap so that I can write to and read from the bitmap using TextOut(dc,----) etc? Do I use SelectObject(), or what?
|
|
|
|
|
Take a look at this article.
Hope this helps,
--Perspx
"The Blue Screen of Death, also known as The Blue Screen of Doom, the "Blue Screen of Fun", "Phatul Exception: The WRECKening" and "Windows Vista", is a multi award-winning game first developed in 1995 by Microsoft" - Uncyclopedia
|
|
|
|
|
Thanks; but I have been writing my own software to handle Windows graphics images and graphics files for many years. I merely need to know how to link an existing bitmap (as identified by its HBITMAP handle), to a device context (HDC), so I can use TextOut(dc,----) etc to write text to the graphics image in the bitmap identified by the hbitmap. Thanks.
(I learned Windows programming in the old days; I do not use classes, except some classes which I wrote for myself.)
Thanks for answering the various queries that I have asked here in the past.
|
|
|
|
|
Oh, I see. You just use:
SelectObject(hdc, bm);
Where hdc is the Device context handle (HDC) and bm is the bitmap handle (HBITMAP).
Regards,
--Perspx
"The Blue Screen of Death, also known as The Blue Screen of Doom, the "Blue Screen of Fun", "Phatul Exception: The WRECKening" and "Windows Vista", is a multi award-winning game first developed in 1995 by Microsoft" - Uncyclopedia
|
|
|
|
|
Anthony Appleyard wrote: Please how do I link the device context to the bitmap so that I can write to and read from the bitmap using TextOut(dc,----) etc?
Like this?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
How can I find the size of a file without opening it? Or if I do have to open it, how can I open it and get the file size when it is already open by another application?
|
|
|
|
|
|
The FindFirstFile() API works fine.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I have Windows Vista.
I am writing an image-handling section in a program. The parts relevant here are:
SIZE sz; char T[256]; BITMAP bm;
// Next I set bm.bmType=0; bm.bmWidth=bm.bmHeight=840; bm.bmWidthBytes=2520,
// bm.bmPlanes=1; bm.bmBitsPixel=24; bm.bmBits = address of the bit pattern of an image;
HBITMAP hbm=CreateBitmapIndirect(&bm);
// which should put in hbm a copy of the bit pattern bm
// Here a test showed that hbm!=0
GetBitmapDimensionEx(hbm,&sz);
sprintf(t,"hbitmap is %d * %d",sz.cx,sz.cy);
MessageBox(0,t,"size",MB_OK);
//which showed that sz.cx == 0 and sz.cy == 0, i.e. the bit pattern in hbm is size 0 * 0, and not as in bm.
Please what may be wrong?
|
|
|
|
|
You should use GetObject() to get the bitmap's dimensions, not GetBitmapDimensionEx().
From the GetBitmapDimensionEx() docs:
"The retrieved dimensions must have been set by the SetBitmapDimensionEx function."
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|