|
I need to draw circles, squares, and lines between them,
with some colors and digits
in simple way.
can someone advice me-
are there such controls ?
please type link or Name.
better with some comment.
thanks
|
|
|
|
|
hi,every one!
i want to change the companyname in my .exe file dynamicly,how to do?
there is a sample at http://www.codeproject.com/samples/UpdateVersion.asp, but it
does not deal with it.who can help me?thanks a lot!
|
|
|
|
|
I didn't get your question exactly. if you are trying to change the title of the application take the handle of the dialog and using SetWindowText() function you can change the name of the exe.
give me some more information about your problem.
|
|
|
|
|
The sample u mentioned has got complete code for changing the CompanyName. I have used this code myself. You just need to understand it fully before using and yes, dont forget to compile your application as unicode to do this. It wont work without that. I am just pasting a snippet of code here from the same article which does this.
CString strSubBlock;
LPTSTR pValueBuffer;
strSubBlock.Format(_T("\\StringFileInfo\\%04x%04x\\CompanyName"),
lpTranslate->wLanguage,
lpTranslate->wCodePage);
VerQueryValue(lpBuffer, (LPTSTR) ((LPCTSTR) strSubBlock),
(LPVOID *) &pValueBuffer, &uTemp);
ZeroMemory(pValueBuffer, _tcslen(pValueBuffer) * sizeof(TCHAR));
_tcscpy(pValueBuffer, _T("My Company, Inc."));
And yes, this Article is by one of the most respected members here. Mr. David Crow
Regards,
Aamir
|
|
|
|
|
Thank you,Aamir Butt!
Yes,i use like that you write, but how can i use UpdateResource function whit the variable 'pValueBuffer'?
This is my code:
CString strSubBlock;
LPTSTR pValueBuffer;
strSubBlock.Format(_T("\\StringFileInfo\\%04x%04x\\FileDescription"),
lpTranslate->wLanguage,lpTranslate->wCodePage);
VerQueryValue(lpBuffer, (LPTSTR) ((LPCTSTR) strSubBlock),
(LPVOID *) &pValueBuffer, &uTemp);
ZeroMemory(pValueBuffer, _tcslen(pValueBuffer) * sizeof(TCHAR));
_tcscpy(pValueBuffer, _T("My Company, Inc."));
if (UpdateResource(hResource, RT_VERSION, MAKEINTRESOURCE(VS_VERSION_INFO), lpTranslate->wLanguage, lpBuffer, dwSize) != FALSE)
{
if (EndUpdateResource(hResource, FALSE) == FALSE)
dwResult = GetLastError();
}
else
dwResult = GetLastError();
But it does not replace the original companyname with "My Company, Inc." finally,perhaps where is wrong, can you help me? thanks a lot!
|
|
|
|
|
freemme wrote: there is a sample at http://www.codeproject.com/samples/UpdateVersion.asp, but it
does not deal with it.
Are you sure?
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Thank you for your code,DavidCrow,they help me very much!
perhaps i don't understand them fully.
Yes,i use like that you write, but how can i use UpdateResource function whit the variable 'pValueBuffer'?
This is my code:
CString strSubBlock;
LPTSTR pValueBuffer;
strSubBlock.Format(_T("\\StringFileInfo\\%04x%04x\\FileDescription"),
lpTranslate->wLanguage,lpTranslate->wCodePage);
VerQueryValue(lpBuffer, (LPTSTR) ((LPCTSTR) strSubBlock),
(LPVOID *) &pValueBuffer, &uTemp);
ZeroMemory(pValueBuffer, _tcslen(pValueBuffer) * sizeof(TCHAR));
_tcscpy(pValueBuffer, _T("My Company, Inc."));
if (UpdateResource(hResource, RT_VERSION, MAKEINTRESOURCE(VS_VERSION_INFO), lpTranslate->wLanguage, lpBuffer, dwSize) != FALSE)
{
if (EndUpdateResource(hResource, FALSE) == FALSE)
dwResult = GetLastError();
}
else
dwResult = GetLastError();
But it does not replace the original companyname 'xxx Company' with
"My Company, Inc." finally,i dont know what is wrong, can you help me? thanks a lot!
|
|
|
|
|
freemme wrote: But it does not replace the original companyname 'xxx Company' with
"My Company, Inc."
Why would you expect it to? You called UpdateResource() with lpBuffer instead of pValueBuffer .
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Sorry,DavidCrow!It is OK now!
Your code is right,it is the question myself.
Thank you very much!
|
|
|
|
|
I am a bit of a newbie and tend to take on projects that are over my head. Anyway, my problem is that I am trying to include header files from one program to another, and commands for winsock are causing an ambiguity in the compilation. The host program compiles fine until I #include stdafx.h which also includes the following (syntax modified because include files not showing up on forum):
#include afxwin.h // MFC core and standard components
#include afxext.h // MFC extensions
#include afxdisp.h // MFC Automation classes
#include afxdtctl.h // MFC support for Internet Explorer 4
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include afxcmn.h // MFC support for Windows Common Controls
I tried to track down the instance of winsock in these afx files to change it (can I do that since the winsock 1 & 2 look almost identical?), but the includes are just compounding.
Does anyone know where I can find the instance of winsock.h in the afx headers? Or maybe there's an easier fix for this? Thank you for any help!
-- modified at 2:04 Friday 18th November, 2005
|
|
|
|
|
In stdafx.h, before all the #include's add:
#define _WINSOCKAPI_ // prevent inclusion of winsock.h in windows.h
Then later on, if you need it, you can add:
#include <winsock2.h>
...cmk
Save the whales - collect the whole set
-- modified at 7:25 Friday 18th November, 2005
|
|
|
|
|
[typeof(MC++)]
If I have a class that inherits from CollectionBase...
and I have an default accessor: Item
__property Object * get_Item(int index)
{
return List->Item[index];
}
How can I get this to serialize as another object (the only one I'm using for this collection)
I've tried changing what is returned, and it breaks when trying to access and claims the class is violating ICollection....
When i use:
[XmlInclude(__typeof(Vehicle))]
The compiler claims:
The type Vehicle was not expected. Use the XmlInclude or SoapInclude attribute to specify types that are not known static
The vehicle class is labeled serializeable.
-Steven Hicks
CPACodeProjectAddict
|
|
|
|
|
Hi
I am having an application which i am using it to get the File opened through the File open/save as dialog in winword . I have a wriiten a hooks program by which i am able to trap the FILEOKSTRING . but the lParam value is NULL when i trap the message . Can anyone please help me .
This is my hooks code
uMsgOk = RegisterWindowMessage("FILEOKSTRING");
g_OpnHook = SetWindowsHookEx(WH_CALLWNDPROC ,(HOOKPROC)SetHook,AfxGetInstanceHandle(),
NULL);
LRESULT CALLBACK SetHook( int nCode, WPARAM wParam, LPARAM lParam )
{
LPOPENFILENAME ofn;
if ( nCode == HC_ACTION )
{
CWPSTRUCT* pwp = (CWPSTRUCT*)lParam;
if (pwp->message == uMsgOk)
{
ofn = (LPOPENFILENAME)pwp->wParam;
}
}
}
although i am able to trap the FILEOKSTRING message the lParam value is NULL .
|
|
|
|
|
Hello all,
Could anyone explain how to link a library statically into an executable in Visual C++ .NET?
My problem is that I'm compiling against library (.lib) files, but I do not have the corresponding (.dll) files. The compilation works fine, but when I attempt to run the application, it falls over as it is not able to find the .dll. It is my understanding that if I statically link the required parts from the .lib files into the executable, it will have everything it needs at run-time and will not go off looking for the .dll. I've looked around the compiler and linker settings within Visual C++ and haven't been able to find anything to make me happy. Googling hasn't produced anything either. Could someone suggest a solution?
Cheers,
Penkov
|
|
|
|
|
|
Thank you for your reply. The options you suggested seem to apply only to the standard C run-time libraries which are provided by MS. My problem is that I need to statically link to my own libraries. I've tried playing around with the /link option, but I have not had any luck with it. Do you have any other suggestions? Thanks in advance.
Penkov
|
|
|
|
|
|
A static library .lib file is not the same as a .lib file used to link to a dll.
The static lib .lib file has all the compiled code.
The dll .lib file only has the export information for the dll.
...cmk
Save the whales - collect the whole set
|
|
|
|
|
Thank you for your reply.
cmk wrote: A static library .lib file is not the same as a .lib file used to link to a dll.
I was under the impression that they are all static libraries... Could you please elaborate? How do I distinguish between one type of .lib file and another?
I haven't done much Windows C++ development (up until now only had to work on Linux). If you could point me in the direction where I can read a bit more about this, it would be great.
Thanks again,
Penkov
|
|
|
|
|
misha1983 wrote: I was under the impression that they are all static libraries... Could you please elaborate? How do I distinguish between one type of .lib file and another?
No, they are not all static libraries.
As i mentioned, you get different .lib files from building a project as a static lib vs a dll.
There is no obvious way to distinguish, you are usually told when you get the file(s).
If you know more about what to expect in these files then you can use a hex editor to look at their contents and tell from that, but explaining that is too involved.
You are usually either given a x.lib and told 'this is a static lib build of our x API', or you are given a x.lib, x.exp and x.dll and told 'here is our x API dll'.
Actually there is a 3rd option, you are given a x.lib, x.exp and x.exe and told 'here is our application, which exports our y API'.
Search MSDN for information on lib, e.g.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/_core_running_lib.asp[^]
...cmk
Save the whales - collect the whole set
|
|
|
|
|
Ok, thanks, that's cleared it up a bit. I've asked around work and managed to dig up the DLLs I needed. So that's taken care of. Thanks to both of you for helping.
Cheers,
Penkov
|
|
|
|
|
I have an Industrial PC with an Embedded Windows XP.
The Embedded Windows XP can only boot up and display a cmd.
I need to control its Digital I/O. I only have the I/O address and Interrupt of it.
At this moment, I am not sure that it has driver or not.
Can any one give any suggestion to me?
Please help!
|
|
|
|
|
If it can only boot up to a prompt then it sounds like the kernel has been built from a reduced sub-system set - sucks for you, sorry.
You would have to look-up any shell commands to query the device sub-system for an appropriate driver, if none exists then you'd have to write one.
I'm suprised you haven't been given an API for the device, or at least told more about the system, makes it tough to help.
The MSDN embedded site has some info on writing device drivers if i remember right:
http://www.microsoft.com/windows/embedded/default.mspx[^]
...cmk
Save the whales - collect the whole set
|
|
|
|
|
In fact that the system don't have any API.
The system is given by other company.
So I have no idea in such situation.
Please help!
|
|
|
|
|
Is it possible to define a class member variable to be read only and also being public? Thx!
|
|
|
|
|