|
SQLConfigDataSource()
suhredayan There is no spoon.
|
|
|
|
|
|
hi ,
I tried using above method..I want to create a DSN for SQL Server database..
I did like this:-
f(!SQLConfigDataSource(0,ODBC_ADD_DSN, "SQL Server\0",
"DSN=great\0"
"Description=great\0"
"Server=PUBUDU\0"
"Database=pubs\0"
"Uid=sa\0"
"Pwd=sa\0"
))AfxMessageBox("Not Created");
else AfxMessageBox("sucsefully created ");
But the answer is "Not created"..
Why can't I create DSN for SQL Server like this?
can you please tell me the problem here and the correct way to create DSN for SQL Server database?
Thanks in advance..
|
|
|
|
|
Define first parameter, change it from 0 to your main window handle, in that case SQLConfigDataSource will open regular "DSN Config" dialog and try to fill its fields with parameters. You will see what is missing, and what ODBC did not understand.
Probably you mistype driver name. Or client's computer does not have such driver at all.
|
|
|
|
|
Although this is a subject with scarce literature available, I'm confident that someone out there has the answer.
I'm trying to send an Inquiry command to the c: drive on my system to obtain
the Model Number, Vendor Id, Firmware Rev. etc...
Once I have scanned the bus for devices and used the CreateFile(); the Inquiry command returns nothing.
Any suggestions and/or code snippets?
P.S. The CreateFile() returns a handle to the device, but the Inquiry command doesn't work!
Many Thanks.
|
|
|
|
|
A project I'm working on is migrating to a different library for communications. The functions are slightly different from what we have been using.
I'd like to find a way to read a source file, identify the old function calls, change to the new function calls and rearrange the parameters to work with the new library.
Basically its sort of like this
Old Way:
class.function(param1, param2, param3)
New way
function(&NewClass, param2, param1, param3)
Any suggestions?
Thanks
Brad
|
|
|
|
|
C++ must die?
The easiest way to do migration between libraries is to create some additional wrapper library. Create a dummy class with the same name as your existing in the old library, and fill its methods with a calls to a new library.
If you want to modify actual code of your application - a tons of text processors at your disposal, starting with grep and even any regular text processor.
|
|
|
|
|
:-DHi All!
I need some help with MFC.
I worked ower some project. It has some "DataMap" (inherited from CWnd) on which can be placed by Drag&Drop some data "Items" which is also inherited from CWnd, and attched as children windows to "DataMap". Item shapes are build in some custom manner (non-rectangular) also I implemented routines for moving, shape change etc.
I got some problem with repainting of "DataMap" - all children windows ("Items") are flicking. For example if I resize "DataMap" it sends WM_PAINT - so itself is repainted and children are also - FLICKING !!!
|
|
|
|
|
|
you are answering in forums again
looks like you have lots of free time
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
Hi,
I really wanted an Vc6 project that could grab text from under the mouse pointer. What i mean is that it extracts the word from under the position of the mouse pointer on the screen. it could be from Microsft word or any other text based application.
There is write up on this but i couldn't get it to work
it's at
http://weblogs.asp.net/oldnewthing/archive/2004/04/23/118893.aspx
The example above uses something called Active Accessibility ...
I was making a dialog based app in vc6 so i wanted the current word from under the mouse to be able to use it for spell check/dictionary search kinda stuff..
Anyone with anything on this topic please help me out.
Will it work both in Windows 98 as well as in Windows XP
Thankyou guys...
|
|
|
|
|
|
I am using C++ compiler and linker from VC++ 2003
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3077 for 80x86
Microsoft (R) Incremental Linker Version 7.10.3077
Application is created for Win32. When I link all my objects into executable, I recieve message "Creating library MyProject.lib and object MyProject.exp" and two additional files. What are this files? Why linker create them? How to tell compiler/linker to forget about them?
|
|
|
|
|
I think these files are only created when you make a DLL. The lib file is an Import Library file which lists all the functions whice are exported by the DLL, and is useful when you want to link this DLL to some host exe at compile time, rather than at run time. The exp file is a compiler temporary, and contains the export table to be combined by the linker to make the final DLL. There must somthing funny going on though, because these files should only be created when you're making a DLL!
Joel Holdsworth
"Outlook not so good"
That magic 8-ball knows everything! I'll ask about Exchange Server next
|
|
|
|
|
Yes, that files are created even if you link into executable. The funny thing is: if you use plain C for all modules - that files wont appear. But as soon as you add at least one C++ object into Link list: you will have that files.
cl -c module1.c
cl -c module2.cpp
link /out:test.exe module1.obj module2.obj
and there they are
|
|
|
|
|
I've imported code from Idepemdent JPEG Group to convert jpeg to grayscale. What I need is to convert to monochrome; either jpeg of grayscale. Does anyone know of an article or group that could help.
Thanks
|
|
|
|
|
Simply BitBlt() it onto a monochrome (1 bit per pixel) bitmap.
HBITMAP MakeMonochrome(const HBITMAP &Colour)
{
HDC hDC1 = CreateCompatibleDC(NULL);
HDC hDC2 = CreateCompatibleDC(NULL);
BITMAP bm;
GetObject(Colour, sizeof(BITMAP), &bm);
HBITMAP Mono = CreateCompatibleBitmap(hDC2, bm.bmWidth, bm.bmHeight);
HBITMAP Old1 = (HBITMAP)SelectObject(hDC1, Colour);
HBITMAP Old2 = (HBITMAP)SelectObject(hDC2, Mono);
BitBlt(hDC2, 0, 0, bm.bmWidth, bm.bmHeight, hDC1, 0, 0, SRCCOPY);
SelectObject(hDC2, Old2);
SelectObject(hDC1, Old1);
return Mono;
}
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it! Honoured as one of The Most Helpful Members of 2004
|
|
|
|
|
Sorry, please excuse my ignorance. I need to do this from a non-windows enviroment which means I have to do all of the grunt work. I know this is a windows group but if somone could refer another group that might help, I would appreciate it.
Thanks again
|
|
|
|
|
OK, then just take your grayscale algorithm and instead of converting each colour pixel into one of the 256 greyscale colours convert each pixel into the two monochrome colours.
psuedo code
grey = (blue * 11 + green * 59 + red * 30) / 100;
pixel = (grey > 127) ? white : black;
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it! Honoured as one of The Most Helpful Members of 2004
|
|
|
|
|
Thanks for the pseudo code. It will take some time to try. If not too lengthy of an explanation, how did you come up with the grey=... formula?
|
|
|
|
|
|
|
Hi,
I have a dialog-based application.
I have 2 2D arrays which wil be used by 2 different dialogs. Creating the arrays involves reading from a file. What I would like to do is to create the arrays as soon as my application starts so that they are readily available when they are needed by the other dialogs.
What is the best way to do this?
What I had thought of doing was letting each dialog have it's own member variables to hold the arrays. I would call a function to initialise them whenever the dialog is made modal.
Or should I have them as global variables?
Which of these is the better way of doing it? Or is there a different way of doing it?
Thanks very much,
dlarkin77
|
|
|
|
|
dlarkin77 wrote:
What I would like to do is to create the arrays as soon as my application starts so that they are readily available when they are needed by the other dialogs.
What is the best way to do this?
You can either make the arrays members of the CWinApp class, or make them static members of a CDialog -based class of which your other two dialogs are derived from.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I was given a data file to read which is in binary format. I was told that the data starts in the file at position 0x1000. Each value following the offset is a 2byte short value. I tried reading in the file using fstream.ReadInt16(). It looks like some of the data is matching up correctly but the other isn't. Below on the left is what the data should be and on the right is what i'm getting
2 2
68 -188
-22 234
18 18
85 85
130 386
454 710
626 114
82 82
127 639
617 617
558 -210
As you can see some of it is matching up. Does anyone know what i'm doing wrong??
|
|
|
|