|
Thank you all for responding my query.
I'm working on it if I find any trouble I will contact you guys again.
sun
|
|
|
|
|
I need to dynamically retrieve ODBC parameters through code in Borland C++. Anyone any idea?
Many thanks
|
|
|
|
|
Priya..k wrote: ODBC parameters
What exact ODBC parameters? Can you please be more specific?
Koushik Biswas
|
|
|
|
|
I have to retrieve the username and password from the ODBC connection and use it in my program which has been developed using Borland C++ version 6. I am using a DataModule in my program where i set the DSN name and the username and password. But now i want to dynamically retrieve the username and the password from the odbc connection. Hence the program will be able to execute for any DSN on any machine.
Regards,
Priya
|
|
|
|
|
Aha! So you are trying to retrieve username and password for one or more DSN-s programmatically. I do not know your purpose, but providing you with a way of doing that is like providing a mechanism by which anybody can hack into a database and wreck havoc with privacy! How can you expect that the password will just be stored somwhere where you can go and pick it up from? If it is easy like that, it beats the purpose of a "password" doesn't it?
Now here is what you can do: DSN entries are all stored in the registry under either HKCU\ Software\ ODBC\ ODBC.INI or HKLM\ Software\ ODBC\ ODBC.INI (depending on whether they're User or System DSNs). You just have to read the correct registry key (key name = DSN Name). If you run regedit and drill down to that location, you will see all your DSN-s listed. For any DSN, the values listed are all or some of these:
Database, Driver, LastUser, Server, Trusted_Connection...
But Password is not stored in the registry. You cannot get the password. As I told you, Microsoft won't be in business long if they provided you a way of getting to that! I am sure the password is stored somewhere encrypted - even if you knew the location, you probably have to retrieve the encryption key to decrypt it. And on top of that, your executable would probably need to set administrative privileges for itself to do any of that.
Koushik Biswas
|
|
|
|
|
Hi
Tools like CPU-Z detect the manufactor of the build-in RAM with Serial Presence Detect (SPD) device on the RAM. How does this work? I think I need a driver on NT-based systems.
Can anyone give me a thought-provoking impulse?
Thanks,
André
'A programmer is just a tool which converts caffeine into code'
|
|
|
|
|
Have a stream of data that is not an IStream.
I am attempting to send this stream to GdiPlus api call "Image::FromStream(IStream*)" for display.
Is there a windows stream function that will do this(i.e. Make this conversion). I tried casting and that was unsuccessful.
|
|
|
|
|
Here is a program to show how this can be done:
#include "stdafx.h"
#include <objbase.h>
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
CoInitialize(NULL);
char YourData[] = "Your data here.";
HGLOBAL hGbl = GlobalAlloc(GMEM_MOVEABLE, sizeof(YourData));
if ( hGbl )
{
LPVOID pMem = GlobalLock(hGbl);
if ( pMem != NULL )
{
memcpy(pMem, YourData, sizeof(YourData));
GlobalUnlock(hGbl);
IStream* pStream;
HRESULT hr = CreateStreamOnHGlobal(hGbl, TRUE, &pStream);
if ( SUCCEEDED(hr) )
{
// Use stream here!
char TestBuffer[1024];
ULONG Read;
hr = pStream->Read(TestBuffer, sizeof(TestBuffer), &Read);
if ( SUCCEEDED(hr) )
{
MessageBox(NULL, TestBuffer, "From the stream", MB_OK);
}
pStream->Release();
}
else
{
GlobalFree(hGbl);
}
}
}
CoUninitialize();
return 0;
}
Steve
|
|
|
|
|
I have a Arcom Digital I/O PCI card installed in my PC.
Now I would like to create a ActiveX control to set and read a few of these I/O channels.
What I would like is use this card in both an MFC application and Web Pages, so never need to use the cards API.
What type of ActiveX do I need to create and how with Visual Studio 7.1. All ActiveX examples I hav seen are done in Visual Studio 6.0
Any comments or links please.
|
|
|
|
|
IME, ActiveX normally means a COM object that has or implements some form of GUI. Sounds like you would just need to wrap the card's API with an automation-capable (automation-capable since you mention "web pages" ) COM object.
You would then be able to use this COM object from all kinds of clients to work with the card.
VS 7.1 should have a wizard (and buttloads of documentation) for creating a simple COM object and the MSDN docs will help you out with the design of the actual interface.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Tip for new SUV drivers: Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
Does anyone have the source code for calulating the hyperbolic sine of an unknown angle, preferable in radian, ( sinh x )?
using of the standard library of sine is not allowed.
therefore im stucked at quite beginning.
anyone can help me please?
im doing this for my project.
thank lots...
|
|
|
|
|
I remember something like this:
sinh(x)=(e^x - e^-x)/2
Right?
Have a nice code day
|
|
|
|
|
It,s right. I checked it.
sinh(x)=(exp(x)-exp(-x))/2
cosh(x)=(exp(x)+exp(-x))/2
where x is in RAD !
Bye, bye
Have a nice code day
|
|
|
|
|
|
Calculator???? Toxcct is not out there! otherwise he'd have tasted your problem like honey!!:->
0x0400:
"But your mind is very complex, very tricky. It makes simple things complicated. -- that's its work. And for centuries it has been trained for only one thing: to make things so complicated that your life becomes impossible."- Osho
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[V]--
|
|
|
|
|
|
hey toxcct somebody had voted you '1'.. i swear its not me!!
0x0400:
"But your mind is very complex, very tricky. It makes simple things complicated. -- that's its work. And for centuries it has been trained for only one thing: to make things so complicated that your life becomes impossible."- Osho
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[V]--
|
|
|
|
|
these days, whatever i write, either serious post or joking is poluating my ranking by voting me down.
seriously, what's wrong with my 2 posts here ?
this starts making me very angry, and i'll tell about it to Chris, because the only thing i "won" since the 3 days i'm back is about 9 votes to '1' when i consider my answers weren't provocating anyone !!!
tell me vivek, you saw i was voted to '1', and you tell you sware it's not you, so i conclude you don't agree with this vote. so, why didn't you counter balance the vote ? humm ?
anyway, Chris will be knowing this during the day, know it everybody !
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VisualCalc 3.0]
|
|
|
|
|
oh my dear.. i'm extremly sorry, i assure you whenever i find you with a '1', i'll give you my 5. ok?? and moreover, most of the time you deserved my 5 coz your replies had helped me a lot. the same '1' issue i had also noticed in aloks post. somebody kept on giving him a '1'.i've been dumb not counter balancing it. dont worry toxcct..i'll do it.. ok? be happy dude
0x0400:
"But your mind is very complex, very tricky. It makes simple things complicated. -- that's its work. And for centuries it has been trained for only one thing: to make things so complicated that your life becomes impossible."- Osho
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[V]--
|
|
|
|
|
you're very nice vivek, thanks to you.
however, i emmit an objection. there's no need to vote me '5' each time i've got a '1', otherwise, ,the voting system has no sense. i'm only angry to get these votes when i don't desrve them...
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VisualCalc 3.0]
|
|
|
|
|
No toxct i just noticed your msg history, someone's giving you '1' deliberately. i'll do my best against it
0x0400:
"But your mind is very complex, very tricky. It makes simple things complicated. -- that's its work. And for centuries it has been trained for only one thing: to make things so complicated that your life becomes impossible."- Osho
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[V]--
|
|
|
|
|
toxcct bTW i dont understand, why selected to reply for my post. i just meant "toxcct is not there in the forum for the moment".. you get me?? "if he is there he'd had have answered you with the best answer" you get it now?? i dont find any reason for putting the "unwell" icon on me
0x0400:
"But your mind is very complex, very tricky. It makes simple things complicated. -- that's its work. And for centuries it has been trained for only one thing: to make things so complicated that your life becomes impossible."- Osho
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[V]--
|
|
|
|
|
humm, that was with a good intention, i wanted to throw a tongue, but yes, i conceed the rest of the face is not willing. i should have put a instead, but i found it not being exact to my feeling at the moment (but don't worry, the is not how i wanted to show me neither...)
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VisualCalc 3.0]
|
|
|
|
|
yes of course...
did you have a look at this ? (*joke*)
seriously, why don't you want to use the standard library ?
if you want to perform the calculation by yourself, you'll have to use assembler for this i believe...
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VisualCalc 3.0]
|
|
|
|
|
How do i define a space for unknown char size?
i dont want to use like char str[50] or char str=new char(100);
size should be infinite and adjust accordingly. if i enter "hi" , it should be of two only bytes.
i'm trying winsock a program, so if the user should be allowed to enter any number of characters. so how??
regards,
Rookie
Installing MFC...2% complete
|
|
|
|