|
For convert jpg to bmp I saw this thread that Mark Salsbery wrote for someone here[^] and also I think Mark can helps you for convert,so I suggest ask of him.
|
|
|
|
|
|
I also want a cximagecrtd.dll, would anyone like give me one copy? My Email is quiettimes@163.com. Thank you very much!
|
|
|
|
|
Hi,
Im trying to read a value of the registry in VC++ using the class CRegKey from the < atlbase.h >
but something is not working. Using the VC++ help I have tried with this code:
CRegKey rkMyRegKey;
CString szValue = "";
LONG lnResult = -9999;
ULONG iLength = sizeof(szValue);
lnResult = rkMyRegKey.Open(HKEY_LOCAL_MACHINE, "SOFTWARE\\DELTALOGIC\\AGLink\\Device0");
lnResult = rkMyRegKey.QueryValue((LPTSTR) &szValue, "IFPARA_TCPIP", &iLength);
rkMyRegKey.Close ();
and it works half correct. The variable iLength gives me the value 1252 in the debugger (the large in Bytes of the entry I want to read), but the szValue has no values and the lnResult is 234 (being 0 = ERROR_SUCCESS) in the previous line. I have look for the error but I didn't found the meaning of the value 234.
After checking the forum and found a post this (march 07)[^] and I have tried this.
HKEY hWkKey;
CString szValue = "";
LONG lnResult = RegOpenKeyEx (HKEY_LOCAL_MACHINE, "SOFTWARE\\DELTALOGIC\\AGLink\\Device0", 0, KEY_ALL_ACCESS, &hWkKey);
if(lnResult == ERROR_SUCCESS)
{ ULONG iLength = sizeof(szValue);
lnResult = RegQueryValueEx(hWkKey, "IFPARA_TCPIP", 0, NULL, (BYTE *) &szValue, &iLength);
if (lnResult != ERROR_SUCCESS)
AfxMessageBox ("Error by requesting the value");
}
RegFlushKey(hWkKey);
RegCloseKey(hWkKey);
And I got the same 234 error and the same value 1252 for iLength, but no result in the szValue.
Can someone tell me what am I not understanding?
-- modified at 9:02 Friday 5th October, 2007
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Nelek wrote: ULONG iLength = sizeof(szValue);
What exactly are you expecting this to do? iLength is the size of the class, not the size of the class' internal buffer.
Nelek wrote: lnResult = rkMyRegKey.QueryValue((LPTSTR) &szValue, "IFPARA_TCPIP", &iLength);
Not even close. Try:
iLength = 256;
lnResult = rkMyRegKey.QueryValue(szValue.GetBuffer(iLength), "IFPARA_TCPIP", &iLength); Nelek wrote: I have look for the error but I didn't found the meaning of the value 234.
Where did you look? It's in winerror.h .
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Sorry for the delayment, I had no oportunity to come before.
1 question:
Quote from Help of VC++ 6.0
"pdwCount [in, out] The size of the string data. Its value is initially set to the size of the szValue buffer."
On the other hand, I was looking for info in the site and I found a place where it was done like this. I tested and, actually, the 1252 was at the end in the variable iLength.
Because of both I used it in that way.
//..............
About the try... 256 gives the same result. Incoming iLength = 256, after the line iLength = 1252.
//..............
I was looking in the atlbase.h because is the header I should include in order to use the CRegKey and afterwards I was looking in every *.h of the folder without success. Winerror.h is in other path.
Anyways... Thanks a lot for your answer, I have learn some things that I didn't know.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
try this given code for reading the registery...
call this like....
Ex.
CString str;
ReadFromRegistry(HKEY_LOCAL_MACHINE,"SOFTWARE\\DELTALOGIC\\AGLink\\Device0", "IFPARA_TCPIP", str,260);
Function:
BOOL ReadFromRegistry(HKEY hRegRootPath, CString strRegPath, CString strRegAttribute, CString &strAttributeValue, DWORD len)
{
CRegKey key;
if(key.Open(hRegRootPath, strRegPath,KEY_READ) == ERROR_SUCCESS)
{
char strvalue[128];
if(key.QueryValue(strvalue,strRegAttribute,&len) == ERROR_SUCCESS)
{
strAttributeValue = strvalue;
key.Close();
return TRUE;
}
}
key.Close();
return FALSE;
}
Rahul Vaishnav
|
|
|
|
|
Rahul Vaishnav wrote: ReadFromRegistry(HKEY_LOCAL_MACHINE,"SOFTWARE\\DELTALOGIC\\AGLink\\Device0", "IFPARA_TCPIP", str,260);
Which will fail miserably since the buffer used by ReadFromRegistry() is only 128 bytes, yet you are telling it the length is 260 bytes.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Thanks for the code and the posterior correction. I am going to try it.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
It looks like you're able to successfully open the registry key.
Your problem is when you're trying to read the contents of the value "IFPARA_TCPIP".
Nelek wrote: Can someone tell me what am I not understanding?
Basically you haven't understood how to use this function and how to interpret the error returned.
The error returned tells that there is more data to be read, i.e. the size of the buffer you provided was too small to hold the contents of the registry value. The length returned is the complete length that is required to hold the data, i.e. 1252 bytes.
Try this after you've opened the registry key successfully (non CRegKey version):
BYTE* pBuffer = NULL;
lnResult = ::RegQueryValueEx( hWkKey, "IFPARA_TCPIP", 0, NULL, NULL, &iLength );
if( (lnResult == ERROR_SUCCESS) && iLength )
{
DWORD dwType;
pBuffer = new BYTE[iLength];
::RegQueryValueEx( hWkKey, "IFPARA_TCPIP", 0, &dwType, pBuffer, &iLength );
if( dwType == REG_SZ )
{
szValue = pBuffer;
}
delete [] pBuffer;
pBuffer = NULL;
}
Read more about ::RegQueryValueEx() here[^] and a list of possible data types to store in the registry here[^].
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Yes, I am able to open and delete keys / subkeys.
I had made a "bypass" to allow not using the QueryValue (testing only the TCP/IP connection with the 1st member), but now I am forced to use it because I have to differenciate between 4 multiple choices. The value are written in a REG_DWORD to know about the option (MPI_S7 = 0x00, TCP/IP_S7 = 0x03, MPI_S5 = 0x06, TCP/IP_S5 = 0x0B). And depending on what is choosen, go through one function or another.
It seems you are right I was not understanding the functions. VS Help is not very understable for me (35% of contents are on English and the rest on german, and I am spanish , even the MSDN on spanish was made with a translator-bot and even sometimes is difficult for me to understand it )
With the example you have provided me (very good explanation thanks) and both links I think I will be able to solve my problem
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Nelek, you have sent sent me a direct email instead of posting to this forum.
Please do not send personal emails unless instructed to do so for a lot of reasons considering you, other readers and the person you're emailing directly.
No apologies needed, you're instantly forgiven the first time.
Now for your questions:
Nelek wrote: Where are REG_QWORD and REG_QWORD_LITTLE_ENDIAN defined? (I find extrange to be able to get some values and other not, Im under VC++ 6.0)
The registry value types are defined in winnt.h. The 64-bit values are defined in later releases of MSDEV than VC6 so you won't find them in your environment.
Nelek wrote: If REG_DWORD and REG_DWORD_LITTLE_ENDIAN have the same value... how is it possible to differenciate them? I have been working with normal and little_endian formats in other parts of the project and it pisses me off :P
A REG_DWORD and a REG_DWORD_LITTLE_ENDIAN are the same and hence declared as the same type since windows is assumed to be running on an Intel-chipset or compatible. "Normal" in this case is little-endian.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
I wanted to try out and learn CORBA with an example, so I downloaded a 60 day trial of Borlands Visibroker.
Having installed it I now tried one of the examples (Bank Agent). However I cannot built this, I get the following error:-
C:\Borland\VisiBroker\examples\vbroker\basic\bank_agent>nmake -f makefile.cpp<br />
'nmake' is not recognized as an internal or external command,<br />
operable program or batch file.
With this rial version, support does not seem to be avaliable!
Another question is can I use Visibroker with Visual Studio 2005 for a C++ solution. I have not seen any examples using Visual Studio 2005, do they exist.
I have been going around in circles with the documentation.
Any help please
|
|
|
|
|
Are u already settle this problem? i also got the same error when i type
"nmake -f makefile.cpp".
please tell me...i also use trial of borlands visibroker.
|
|
|
|
|
I now use ACE_TAO Corba and so I have left BORLAND stuff unresolved.
CORBA seems such hard work for what it offers and freeware makes it more difficult.
However ACE+TAO on Windows using Visual Studio 2005 is the best I have seen.
Get it from here http://www.theaceorb.com/downloads/1.5a/index.html
[^]">
|
|
|
|
|
tq so much for ur help..i really appreciate ur help....now, i already download and install ACE+TAO 1.5a on linux...this is the steps I follow to run CORBA using GNU C.
1. create a workspace
mkdir Messenger
cd /ACE_wrappers/Messenger
2. Create IDL file
3. Run IDL Compiler
tao_idl -GI Messenger.idl
4. create Server.cpp and Client.cpp
5.Create Build File (MPC)
i create GettingStart.mpc file
6. Run mwc.pl
mwc.pl -type gnuace
I stucked at 6th step...
when i run this command, the following message come out
"bash:this command not found"
i already install perl 5.6.2..
please help me..
|
|
|
|
|
Hi, I did get the Messenger example working, but never used mwc.
Try and build using gmake.
You can use
gmake realclean #for a clean build
Remember they are so many build files (Windows, Borland, gcc compiler etc. You need to use (I think) GNUmakefile.
The scheme using the IOR file works, but the Naming Service is a bit 'all over the place'
Hope this helps.
|
|
|
|
|
Hi again, i was build using "gmake realclean #for a clean build". it works...
but now, may i know how to run Messenger?
I was used "./MessengerServer"
but the errorvmessage come out, "bash command not found".
I really appreciate your help..thank you
|
|
|
|
|
Open up a term Window and check if the executable program is where you think it is.
They are a Perl script called run_tests.pl to run both Client and Server using an IOR file.
I am not an expert on Unix, but it all should work, Perl is free so check if you have it.
|
|
|
|
|
thanks!
i am not expert on developing network...
my question is how to create IOR file?
u help me a lot..
|
|
|
|
|
You just give the name of the IOR file and it gets created with the data.
e.g.
server -o my_ior_file
client -f my_ior_file
|
|
|
|
|
hello to all,
how to create new ".rc" file which will contain all the information about the resources added in ur project and how to add this ".rc" file in your project?
Thanks and Regards,
A.Kulkarni
|
|
|
|
|
Create a new project. Add something to your resources using the resource editor. Then look or the name of one control (i.e. IDD_MYCONTROL) with the binoculars button where the toolbar. One of the matches will be in MyApp.rc and the other will be in resources.h.
Make a double click in the result of the *.rc, a window will tell you something about opening the resources in the editor, say yes and enjoy taking a look.
You can put as much resources in your resource editor as you want. Afterwards you can check how it is configured and created using this.
Once you know how. Just make it at your own taste with a text editor and put the extension *.rc when saving as.
Hope it helps
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
hi all.
I have some problem with I/O stream.
I write console application, that start another process "B".
process "B" write's some information in consle.
I need to read this message and if you can tell how I can set that out stream of process "B" wos input stream for my program.
is there some function or other way to do read this information.
|
|
|
|
|
|