|
|
HI All,
While installing my Application's MSI , it has to prompt for ODBC Data Source Administator Dialog screen , from which i can select my DSN name , UID , PASSWORD...
Please let me know ..
Ur Help much Appreciated.
Regds
Jain.
|
|
|
|
|
Hi Jain,
the ODBC Adminstrator dialog is a control panel applet named ODBCCP32.CPL. It is found in %WINDIR%\system32. The dialog is opened with control.exe like this.
C:\Windows\System32\control.exe ODBCCP32.CPL
Regards
Frank
|
|
|
|
|
Thanks a lot Frank...
Ur answer is really wounderful..
Meanwhile is there anyway to get a list of all available services in separate dialog box.
Regds
Jain
|
|
|
|
|
Hi, i am in trouble with the following:
//function declarations//
void function1();
void function2(BYTE *temp);
//functions//
void function1(){
BYTE temp;
function2(&temp);
}
void function2(BYTE *temp){
int i;
for(i=0;i<10;i++){
temp[i] = 1;
}
}
How come temp can be used as an array in function2 ? function2 requires a pointer to BYTE value not a BYTE array...
TY
|
|
|
|
|
yeah1000 wrote: function2 requires a pointer to BYTE value not a BYTE array...
in C/C++, there is no (syntactical) difference between a pointer to a single variable and a pointer to the start of an array.
|
|
|
|
|
|
Nemanja Trifunovic wrote: It is unfortunate that it compiles at all
I don't think so.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
CPallini wrote: I don't think so
Care to explain?
[edit] Never mind - my remark would make sense if his second function was declared to have an array as parameter - somehow I thought it was [/edit]
modified on Tuesday, November 24, 2009 2:24 PM
|
|
|
|
|
Well, which is cleaner?
1)
for (i = 0; i < 7; i++)
DoSomething (ptr [i]);
2)
for (i = 0; i < 7; i++)
DoSomething (*(ptr+i));
3)
for (i = 0; i < 7; i++)
DoSomething (*ptr++)
1 & 2 do the same thing.
3 messes up ptr too.
Iain.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need contract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
That's fine, but I don't see what it has to do with my observation that array decay was an unfortunate decision by creators of C.
If it wasn't for that, you could declare a function to accept either an array or a pointer, but it would be a compile error if you passed a pointer when an array is expected (look at OP).
[edit] Now that *I* looked at OP carefully, I see that my remark does not make sense. Somehow, I thought his second function was declared to take an array, and it really takes a pointer. [/edit]
modified on Tuesday, November 24, 2009 2:25 PM
|
|
|
|
|
See here.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hi there,
I have an application that should report the state of some sockets within the app but to different class. like if the socket number 0 is connected I send data 00010000 and if socket 0 is disconnected I send 00000000
if socket 1 is connected I send 00010001 and if it is disconnected I send 00000001 so the first 2 bytes shows if the socket is connected or not and the 2nd two bytes shows the socket number. here is the code:
void HHost::HCommsLink( LPVOID lpData )
{
MsgClass *pMsg;
pCmdWrapper_t CmdPkt;
TCHAR Buff[MIN_LOADSTRING];
INT BuffLen;
CmdPkt = ( pCmdWrapper_t )lpData;
try
{ if( CmdPkt )
{
// Format the State message.
memset( Buff, '\0', MIN_LOADSTRING );
BuffLen = 0;
// Socket State.
Buff[BuffLen++] = (( CmdPkt->Param1 >> 8 )& 0xFF );
Buff[BuffLen++] = ( CmdPkt->Param1 & 0xFF );
//Socket Number.
Buff[BuffLen++] = (( CmdPkt->Param2 >> 8 )& 0xFF );
Buff[BuffLen++] = ( CmdPkt->Param2 & 0xFF );
//send message to Ap.
if( pMsg = new MsgClass( HMSG_ORIGIN_IN, 0x00 ))
{
NewCnt++;
pMsg->Hdr.MsgType = 120;
pMsg->SetData( Buff, BuffLen );
// Send to APClass.
if( hMail->MboxPostTo( MBOX_WE_APClass, MBOX_DATA, ( LPVOID )pMsg, ( LPVOID )MBOX_LPARAM_MSG )> MBOX_ERR_SUCCESS )
{
LogError( "HHost", "HCommsLink", "Error: Sending Msg to AP class" );
delete pMsg;
DelCnt++;
}
}
}
}
catch( ... )
{
LogException( "HHost", "HCommsLink", 0 );
}
}
now I need to change the logic so that each message that I send has the info for all the sockets like if socket number 0 is up I send 00000001 and if socket 0 is down I send 00000000 and for socket 1 if it is up I send 00000010 .... finally if I send 00010111 that means sockets 0, 1, 2, and 4 are up and the rest are down, I need to care about 8 sockets, I am having difficulty implementing this.
I appreciate any help.
best Chan
|
|
|
|
|
start with
socketflags = 0;
then for each socket number (total of N sockets):
for (i = 0 ... N-1)
if (socket[i] is up)
socketflags |= 1 << i;
then socketflags will contain the value you want. I'm assuming thats your question?
|
|
|
|
|
Thanks a lot for response but I have problem displaying it in my code Param 1 shows the socket state and Param 2 shows the socket number, so I should have:
if ((CmdPkt->Param1 == 0x00) && (CmdPkt->Param2 == 0x00))
// socket 0 is down
{
//here I have to set the data to send to another class and I don't know how to show it
// like Buff[BuffLen++] = (( 0x00 >> 16 ) & 0xFF );
}
Thanks,
Chan
|
|
|
|
|
Try the below. If the socket is up, then it sets the bit for that socket in the flag variable.
flag = 0;
if (CmdPkt->Param1 != 0)
{
flag |= 1 << CmdPkt->Param2;
}
|
|
|
|
|
Thanks a lot, I needed array structure for this and finally could figure that one out.
Regards,
Chan
|
|
|
|
|
Hi,
Requirement : Need to add a service while installing a MSI ( in VS2005)
So I have added installutil.exe to my Setup project -> Custom Action
and i modified the installutil.exe properties as C:\program\testing1.exe ( in Argument Column)
After doing build and install, i am not able to see any service for my application , meanwhile ..i am able to see my application testing1.vshost.exe in TASKMANAGER.
your help much appreciated
Regds
Jain
|
|
|
|
|
Did you make sure the account you are using have the proper privilage to install a service?
|
|
|
|
|
Yes Loyal, i have administrator rights on this machine..
Meanwhile is it possible to install a service in Setup project using installutil.exe in CustomAction.
If not please provide a alternative solution.
|
|
|
|
|
Hi All
I have developed a windows based application in VC++
The GUI Interacts with the DB and shows the result in the windw..
Til now am working fine.Now the next task is to download the available data from the DB to the excel sheet.
Can anyone guide me to do??
Thanks
Gany
|
|
|
|
|
Simply write the data as a CSV file[^]. Excel can handle a CSV file.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
CSV is a good way to go as the other poster suggested. If that doesn't do it you could resort to using the Excel OLE Automation interface.
|
|
|
|
|
hellogany wrote: Now the next task is to download the available data from the DB to the excel sheet.
Can anyone guide me to do??
You can also interact with Excel via ODBC. If you are using MFC, check out CDatabase and CRecordset . You'll need to create a DSN.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
I believe that you can execute sql server code to create an xls file automatically. You also could use COM to create an excel file yourself.
Taken from another article I read
[^]
you can use
1> DTS Export/Import utility for that please go thru
http://support.microsoft.com/kb/319951[^]
2>exec master..xp_cmdshell but for that you need to enable from surface area configuration
3> BCP utility
4> you can use linked server for excel file to sql table.
INSERT INTO OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=\\servername\e$\inetpub\wwwroot\game\myexcelfile.xls;',
'SELECT * FROM [scores]') select * from LinkedServerName.DBname.tbl_Stats
5> SSIS package to transfer data from a table in a SQL Server 2005 database to a Microsoft Excel spreadsheet
Reasons are not Important but Results are Important.
Swati Tripathi
|
|
|
|