|
Hi,
Link doesn't works, I'll try it later, what's the article that I must see?
Thanks for reply.
|
|
|
|
|
Hi again,
Now it runs! I see this article yesterday, but I can do it works propertly, today I'll read it again.
Thanks, c u later
|
|
|
|
|
Alright lets say I want to get the value from a particular registry key. How would I go about programming that to actually accomplish this feat.
Key: HKEY_CURRENT_USER\Software\Microsoft\Windows\Test
Name: home
value: testvalue
|
|
|
|
|
RegOpenKeyEx followed by RegQueryValueEx followed by RegCloseKey
|
|
|
|
|
Would this correctly output the value located in said key, with the name of "home" into the variable value that I've defined.
char* value = NULL;
LONG l = 0L;
HKEY hKey = {0};
l = RegOpenKeyEx (
HKEY_CURRENT_USER,
_T("Software\\Microsoft\\Windows\\Test"),
0,
KEY_NOTIFY,
&hKey );
if(l == ERROR_SUCCESS)
{
// The following call will wait until a change is made to the registry key.
l = RegQueryValueEx(
hKey,
TEXT("home"),
NULL,
NULL,
value);
RegCloseKey(hKey);
|
|
|
|
|
Matthew Devine wrote:
I want to get the value from a particular registry key
Use CRegKey defined in atlbase.h
Matthew Devine wrote:
actually accomplish this feat.
Key: HKEY_CURRENT_USER\Software\Microsoft\Windows\Test
Name: home
value: testvalue
here is the small piece of code to accomplish that
CRegKey l_regKey;
if( l_regKey.Open(HKEY_CURRENT_USER,"Software\\Microsoft\\Windows\\Test")!=ERROR_SUCCESS))
return;
DWORD dwCount=0;
l_regKey.QueryValue(NULL,_T("home"),&dwCount);
LPTSTR pszRetStr=new TCHAR[dwCount+1];
if(l_regKey.QueryValue(pszRetStr,_T("home"),&dwCount)==ERROR_SUCCESS)
{
MessageBox(pszRetStr,_T("Registry Value"));
}
if(pszRetStr)
{
delete [] pszRetStr;
pszRetStr=NULL;
}
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
Thanks alot for the help, I was able to implement your code perfectly Alok. Again much appreciated.
|
|
|
|
|
Matthew Devine wrote:
Thanks alot for the help,
Mention Not Please
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
I was trying to now look up the registry key value of ProxyEnable:
This is located in "Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings", I was trying to edit your code to work with the fact that this is a DWORD. But I can't seem to get it to work, what I want to do is query the value of that key. After I have the value I just want to write a simple if-statement that will execute ProxyOn() method if the Proxy is seen as being enabled and a ProxyOff() method if the proxy is disabled. Any assistance would be greatly appreciated.
|
|
|
|
|
im trying to make myself a new library using visual studio and everything i try doesnt seem to work. i think that i got a library, but im not sure if its the right type or if i made it right. and if i did it right i have no idea which header to use or how to call my functions from each library.
i understand that this is probably a hard subject to explain over a computer but any help would be greatly appreciated.
thanks
dudeoffrance
|
|
|
|
|
How to make a library can be ambigious. There are many types. You could have .dlls, or .libs that are directly linked into the program or just a directory of headers or even headers with source. I'd consider those all libraries. So how to make each one.
To make a library which is used at runtime, use .dll. Make a new win32 application that is a dll project and then in the project you want to use the .dll, include the header to the .dll. Source is not needed, but the header will always be needed for whatever library you make. Unless you do COM or things of that nature.
To make a library where no .dll is required because you wanted it linked in statically use a .lib. Create a .lib project for your library and then in the client project add the .lib to the linker tab in project settings and include the header.
For the other two just make sure the client application includes and has access to the files needed. This is the simplest of libraries.
|
|
|
|
|
okay, i did that but what do i put in the #include< > at the top of the client app.?
dudeoffrance
|
|
|
|
|
I have a problem with images which I export from a Power Point presentation into an emf file.
When I go record by record through the file, the coordinates I receive are huge (1000's). However inside the presentation the item may only be 100x20.
Does anyone know of a way to convert the huge coordinates into the one's that are usable in the normal coordinate space?
Thank you.
Ilya
|
|
|
|
|
EMF coordinates are stored in HIMETRIC (.01 millimeter) units.
See HIMETRICtoLP() for conversion to logical device units.
|
|
|
|
|
Thank You Shog,
the function you mentioned does seem to make the coordinates more realistic. However I am still having a problem getting the accurate coordinates. The problem I am having is when I pass a RECT to the EnumEnhMetaFile function (which according to MSDN should bind all the drawing calls to within that rectangular region), the coordinates are still outside of the rect. I may pass in (0,0,100,100) but i will get coordinates that are somewhere in the seven hundreds. And to top that off, I have noticed that regardless of the RECT I pass in, the coordinates the function returns always stay the same (as long as the image is the same).
Any suggestions as to what I may be doing wrong?
Thank You,
Ilya
|
|
|
|
|
hiho@ll
anybody knows a good tool which can analyze my code (or just an C/C++ (would be cool with some MFC or "windows" features)) and show me the cross references of my code:
which function is called by which code
i know xref for linux, but is there a similar prog for windows (maybe graphical)
what i finally want is to learn "foreign"-code faster, because sometimes i have to read code from someone other and it's a little bit hard to read it without a good overview
thx@ll
|
|
|
|
|
Visual Studio has one already built into the IDE. Just select Source Browser (Alt+F12) from the Tools menu.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
hmm
would be cool
but if i search Tools i don't find a source browser
and using Alt+F12 i get a "Find Symbol" search window
??
|
|
|
|
|
Perhaps you did not select Source Browser (I think it was in the tools area) when Visual Studio was installed??
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
i tryed to install more tools for visual studio in case i didn't install the source browser, but i installed the whole visual studio!!
this means (and i think i didn't something wrong) there is no source browser in visual studio .NET !(?)
anybody knows an alternative
|
|
|
|
|
ThinkingPrometheus wrote:
...there is no source browser in visual studio .NET !(?)
I wish you would have mentioned this detail up front. My comments were for Visual Studio v6.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
I am looking for a command that will launch an executable when a button is pressed. I want my program to sit and wait while the other program is executing. Whats the best way to go about this?
Thanks
|
|
|
|
|
See here.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
|
How does one load the contents of an HTML resource into a CString?
Here's what I have thus far:
HRSRC hSrc = FindResource(NULL, MAKEINTRESOURCE(IDR_HTML_HEADER), RT_HTML);
HGLOBAL hHeader = LoadResource(NULL, hSrc);
CString szHeader("");
~Nitron.
ññòòïðïðB A start
|
|
|
|