|
Hi Mark,
I want a separate thread for each download and maybe wait for all of it to finish or let the app proceed while downloading whichever is ok with me.
Thanks,
Jayjay
|
|
|
|
|
is there an x64 version of HTMLHELP.LIB ?
i'm trying to migrate a project to x64 and i'm getting an unresolved external on HtemlHelpA.
::HtmlHelpA(NULL, path, HH_DISPLAY_TOPIC, 0);
the function is defined in htmlhelp.h, but it doesn't seem to be in the .LIB .
i've done all the googlin i can take.
|
|
|
|
|
Hi all,
in my application i want to read all the key and data values of some registry folder so i am using this RegEnumValue function but when i kept this function in for loop it is reading few values and failing in the middle..
can anybody suggest me the reason for this i attach the code i have used for this...
<br />
CString names[100],values[100];<br />
CString Accesspath;<br />
char szBufferReturn[MAX_VALUE_NAME];<br />
char szData[MAX_VALUE_NAME];
DWORD nDataSize = MAX_PATH;
DWORD dwType = 0;<br />
DWORD nBufferReturnSize = sizeof(szBufferReturn);<br />
long nReturnCode = 0;<br />
int i=0;<br />
Accesspath = "SOFTWARE\\XYZ\\ImageScanner\\checkfinal";<br />
<br />
HKEY hKey;<br />
for( i =0 ;i< 10; i++)<br />
{<br />
<br />
if( ERROR_SUCCESS == RegOpenKeyEx(HKEY_LOCAL_MACHINE,Accesspath,0, KEY_ALL_ACCESS,&hKey))<br />
{<br />
if ((nReturnCode = RegEnumValue(hKey, i,<br />
szBufferReturn,<br />
&nBufferReturnSize,<br />
NULL,<br />
&dwType,<br />
(LPBYTE)szData, <br />
&nDataSize)) == ERROR_SUCCESS)<br />
{<br />
<br />
<br />
names[i]=szBufferReturn;<br />
MessageBox(names[i]);<br />
nBufferReturnSize = sizeof(szBufferReturn);<br />
<br />
if (dwType == REG_SZ)<br />
{<br />
values[i]=szData;<br />
<br />
}<br />
else<br />
{<br />
printf("Identifier contains a non-string'\n\n");<br />
MessageBox("failed");<br />
}<br />
}<br />
else<br />
{<br />
MessageBox("failed");<br />
}<br />
RegCloseKey(hKey);<br />
}<br />
else<br />
{<br />
MessageBox("not openeded");<br />
}<br />
<br />
<br />
}
<br />
<br />
|
|
|
|
|
hariakuthota wrote: ...and failing in the middle...
Are we supposed to guess where?
"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
|
|
|
|
|
Check the error code returned by the failing function. It can shed more light into the problem.
You can also check the last error code. Call GetLastError() or add @err,hr to watch window to get the last error.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Most likely the problem is that the call to RegEnumValue will change the value of nDataSize (that's an IN/OUT parameter).
You need to reset it before each call.
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
I want to have 2 different configurations that use two different versions. For example, Release configuration I want to be v6.0 and ReleaseOlder to be v4.6 Anyway to do this? I"m using VS2008
Thanks
-C
|
|
|
|
|
Just put an #ifdef #endif block in your resource file.
e.g
----- Resource.h ---------
#ifndef resource_h
#define resource_h
#define use_manifest
#endif
----- Resource.rc --------
#include <windows.h>
#include "resource.h"
#ifdef use_manifest
LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
1 RT_MANIFEST ".\\manifest.xml"
#endif
This code would require that InitCommonControls was called somewhere and that the appropriate library was linked. You could use the use_manifest #define to conditionally include <commctrl.h> & call InitCommonControls.
modified on Thursday, August 28, 2008 1:38 PM
|
|
|
|
|
You'll need to have a preprocessor constant that's unique to each config. For this example, imagine it's debug vs. release. Debug builds have _DEBUG defined, while release builds have NDEBUG .
Right-click on the VS_VERSION_INFO resource and pick Properties. On the Condition line, enter _DEBUG .
Then make a copy of that resource, and in its properties, enter NDEBUG on the Condition line. After you set that condition, you can change the ID back to VS_VERSION_INFO , and you're done.
(This is in 2005 but it should be similar if not the same in 2008)
|
|
|
|
|
I am trying to read the contents of a txt file
using the internet session in an activex session
with no reading results, I have tried the same
method in an application and it works fine.
Does anybody know whats going on.
thanks v much simon
|
|
|
|
|
Hi all,
I am writing an application that checks the correct functionality of a keyboard.
I am doing so by overriding the PreTranslateMessage(MSG *pMsg).
In my PreTranslateMessage i am catching all the WM_KEYDOWN and WM_SYSKEYDOWN messages and read from the wparam which key was pressed .
I have 2 problems:
1.
When pressing the start button (VK_LWIN), the start button is actually pressed and the start menu is opened. The menu is being opened even if i put a break point in the beginning of my PreTranslateMessage. I just want to know when the start button was pressed and i dont want it to open the start menu.
2.
It seems that the print screen button doesn't generate any of the 2 messages that i process in the PreTranslateMessage. what is the window message that is generated when i press the print screen key?
Thanks
Simon
|
|
|
|
|
Have you tried using SetWindowsHookEx() with the WH_KEYBOARD or WH_KEYBOARD_LL hook procedure? Look at the docs here.
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
Introduction to Object-Oriented JavaScript
|
|
|
|
|
Those two buttons, and a couple of others are special. They're not forwarded to your application at all, instead Windows processes these key combinations internally. It's like Ctrl+Alt+Del
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
Is there a way to catch those key strokes before Windows processes them?
|
|
|
|
|
Yes, by using SetWindowsHookEx() withWH_KEYBOARD or WH_KEYBOARD_LL, as Perspx said.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
Can anyone help me, or at least point me to some good sites that will help with reading and writing binary files on the fly without using an array?
|
|
|
|
|
Binary files and arrays have nothing to do with the other.
"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
|
|
|
|
|
Ok then, well that only answered part of my question. How do i read and write a binary file, what are some keywords i should be looking up?
|
|
|
|
|
you can use fopen, fread, fwrite, and finally fclose. google for those functions.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
That all depends on what you are using to open/create the file. Some possibilities include:
fopen()
CreateFile()
CFile
ofstream Each of these has their own way of opening/creating a binary file.
"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
|
|
|
|
|
With fopen, fread and fwrite.
Here's a rough n nasty example:
#include <stdio.h>
#include <stdlib.h>
int main()
{
FILE *fp;
long i;
long fLen;
long tmpValue;
fp = fopen("test.dat", "r+b");
if (fp == NULL)
{
printf("File doesn't exist\n");
printf("creating...\n");
fp = fopen("test.dat", "w+b");
}
if (fp)
printf("File opened successfully.\n");
else
return -1;
for (i=0; i<100; i++)
fwrite(&i, sizeof(i), 1, fp);
fseek(fp, 0, SEEK_END);
fLen = ftell(fp);
fseek(fp, 0, SEEK_SET);
for (i=0; i<fLen/sizeof(long); i++)
{
fread(&tmpValue, sizeof(long), 1, fp);
printf("%4d", tmpValue);
}
fclose(fp);
return 0;
}
|
|
|
|
|
Thanks, this looks quite helpful, i will get to work on this
|
|
|
|
|
Hi All
I have a question about mouse right click.I want to do if mouse right click on MyComputer Drive(C:\,D:\,...) then Message Show of Drive Name.
User click on C:\ drive then message show C and if user click on D:\ drive then message show D.
Is it possibel?If yes then how can i do?
Plz help me
|
|
|
|
|
Do you need this implimentation in Explorer window?
-@SuDhIrKuMaR@-
|
|
|
|
|
can you give me API or example for this..
Plz help me
|
|
|
|