|
Hi,
Yes I am able to add accelerator keys using Accelerator tabel to individual buttons. But I have one problem. I'm unable to display the underscore symbol beneath the letter in the caption for Buttons(Toolbar buttons) for the user to know that accelerator key is present.
Madhavi
|
|
|
|
|
Hai frens.. .
I have created a modeless dialog. . .I am creating the modeless dialog with their parent as desktop, in order to send dialog behind the parent window once the parent is clicked. Now i have a prblm that once the modeless dialog is closed the parent is not getting activated. . Only if i click on it its getting active.Could any one help me to over come this prblm. .
Tanx
bye
|
|
|
|
|
Hi,
you can use the function SetForegroundWindow() using the window address to make it active
Sujan
|
|
|
|
|
I tried using that fnction its not working. . .
my application is an form based SDI.
I tried to bring parent to fore ground on the close of child.
but its not working.
Do any boby have some other solution.
Tanx
bye
|
|
|
|
|
here is a code snippet I found on this site a few weeks ago. I think the title of the article is something like "Dialog box tips & tricks". I haven't tried it yet, but I thought it may come in handy, so I put it in my Code Librarian:
AttachThreadInput(
GetWindowThreadProcessId(
::GetForegroundWindow(),NULL),
GetCurrentThreadId(),TRUE);
SetForegroundWindow();
SetFocus();
AttachThreadInput(
GetWindowThreadProcessId(
::GetForegroundWindow(),NULL),
GetCurrentThreadId(),FALSE);
Who are all these people and what are they doing in my house?...Me in 30 years, inside a grocery store
bdiamond
|
|
|
|
|
Hi!
I'm currently programming some tool that installs a process (automatically running at startup as admin), which accepts incoming network TCP connections, processes some data and returns something. Think of something like a FTP or web server. I'm using Windows 2000.
Now I got a problem: while I'm logged on, the tool works perfectly, everything runs fine. The server accepts all clients and returns the correct data. But when I log off, Win2k doesn't accept incoming connections any more...
It's not the process what isn't working, the process remains perfectly in the background and isn't killed or stopped. It's just that Windows 2000 seems to block incoming connections while nobody is logged on... As soon as somebody is logged on, the server gets the incoming connections again...
Any way to tell Win2k to accept incoming connections while nobody is logged on?? Maybe we can even define the port?? Or maybe I must call something from my program?
Thanks and best regards
|
|
|
|
|
Are you using the shell to do some work for you? Because there is no shell when no users are logged on...
If you havn't, you should develop your program as a service[^].
Hope this helps..
Multiply it by infinity and take it beyond eternity and you'll still have no idea about what I'm talking about.
|
|
|
|
|
I made push-like box like button, and wanna to set colour for both caption and background frame. as we know, for button, we can choose its owner draw property, and then make whatever change as long as we implement its corresponding functions.
but for push-like box, it dun have such owner draw property, and then how can i do?
thx
|
|
|
|
|
Hello All,
I have requirement in a vc++ application, wherein i need to select a few tables from the database on remote sql server(in the same LAN ) and copy them to my local sql server database using VC++ with no direct user interaction with 'MS sql server Enterprise Manager'.
Ofcourse GUI is provided for user to select the tables in the remote sql server database, that i can do in vc++.
Please help me solve this problem.
Thanks & Regards,
Prax
|
|
|
|
|
u do not need any user assistance while u r copying data from table to another, just create two databases variables and open both ODBCs then connect to both sender record set and receiver record set, start copying from sender to receiver, easy....
u can use your own overloaded RecordSet classes or simply and more than enough MFC RecordSet class...
|
|
|
|
|
Hi Friend,
From what i understood after reading ur mail, i wrote the following code for my application....................
//NOTE: 'CCustomer' is CRecordset derived class of 'Customer' table in SQL Server; 'GetConnectionStr' is my function which returns the CString on the Connection String.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
CDatabase m_dbMaster;
CDatabase m_dbField;
m_dbMaster.OpenEx(_T(GetConnectionStr(MASTERDSN)),CDatabase::openReadOnly)
m_dbField.OpenEx(_T(GetConnectionStr(FIELDDSN)),CDatabase::noOdbcDialog)
m_dbField.BeginTrans();
CCustomer m_recFieldCustomer(&m_dbField);
CCustomer m_recMasterCustomer(&m_dbMaster);
m_recMasterCustomer.Open(CRecordset::snapshot,_T("SELECT * FROM Customer"),CRecordset::readOnly);
m_recFieldCustomer.Open(CRecordset::dynamic,"SELECT * FROM Customer",CRecordset::none);
m_recFieldCustomer=m_recMasterCustomer;//Copying the Master recordset to Field recordset
m_recMasterCustomer.Close();
m_recFieldCustomer.Close();
m_dbField.CommitTrans();//COMMIT TRANSACTION FOR THE FIELD DATABASE
m_dbMaster.Close();
m_dbField.Close();
>>>>>>>>>>>>>>>>>>>>>>
Result: When i try to Compile the above code it gives error :
" 'CCustomer' : 'operator=' function is unavailable"
If you think i need to change my code or u have any other issues , please let me know. i would clarify them.
waiting for ur reply..........
Regards,
Prax.
|
|
|
|
|
yes sure, it is obvious that operator = is not overloaded in CRecordSet, all what u have to do now, is to create one function where you assign the master recordset values to the receiver recordset
for example your master table A has CustomerRef ,customerName etc...
all what u have to do is
ReceiverRecordSet.CustomerRef = MasterRecordset.CustomerRef
make sure you are assigning the right fields... Voila...
do not forget while (!masterRecordSet.ISEOF()) etc...
|
|
|
|
|
OK, i got what u meant to say... OK , is there any other way to move the entire table to the remote sql server in just one command .... like 1) using BCP utility & 2)using BULKINSERT... BUT here i am facing some issues ..
1) while using BCP utility , i am not able to handle any exceptions, and also i cannot include it between BEGINTRANSACTION --- COMMITTRANSACTION of CDatabase Object.
it wil show up a console window when v use BCP. and if there is a network failure while tranfering data then the window wil remain constant , the user has to cancel it , then only next line of code will be executed.
2) when i am using BULKINSERT , which is meant to move DATA from a 'file' TO 'SQL SERVER', but i cannot use BULKINSERT to move data from 'SQL SERVER' to 'file'.
SO that is half done with BULK INSERT.
SO IF u have any idea for how to move data between two servers, similar to Import/Export wizard in SQL SERVER Enterprise manager , please help.
Regards,
Prax.
-so radih9999, whats ur real name, what u do & where u dwell?
|
|
|
|
|
in CDatabase class there is one ExecuteSQL(CString) command... In CString u can say
"Insert into targetTable (F1,F2,etc..)
Select Master.F1,Master.F2 from Master" soooooooo simple...
My Name is Rabih and I am lebanese with CCE grade and 4 years of C++,MFC,GDI+ etc... experience
|
|
|
|
|
I did something like that before. What I did was create a DTS package in my SQLServer database and saved it. Then I called ShellExecute() on the Dtsrun.exe and sent it in the appropriate string for servername, password,etc. Here's an example (items in bold will have to be replaced by your appropriate values):
ShellExecute(NULL,"open","dtsrun.exe","/S SERVERNAME /U USERNAME /P PASSWORD /N PACKAGENAME",NULL,SW_HIDE);
So I think I set up the export in SQLServer, then opted to save it as a package, then BAM! I think that was a lot easier. Plus, the server is doing the work for you.
Who are all these people and what are they doing in my house?...Me in 30 years, inside a grocery store
bdiamond
|
|
|
|
|
Hi Guys,
The 'shellexecute' one is good , but how to call it from vc++ application, please give me step by step details for the whole process. AND can v handle exceptions for 'shell execute' and can it be kept between BEGIN & COMMIT TRANSACTION of CDatabase Object?
And Ribah, how can v refer to the table(F1,F2...) name on a remote server in "INSERT INTO (.F1,F2.......)......." please explain.
hey guys please take ur valuable time and help me one last time. if i can do this , my biggest task in my project wil be done.
Waiting for ur reply..........
Regards
Prax
|
|
|
|
|
i have 2 class a and b like this:
//heder file a
#include "b.h"
class a
{
b objb;
}
//heder file b
#include "a.h"
class b
{
a obja;
}
vc++ can not complie these codes
please tell me how can i do that?
|
|
|
|
|
u cannot do this even if it compiles, object are wrong, just create a parent object class for both and inherite a & b classes from it then u publish an Object variable in both classes and on runtime u cast it to whatever u want...
|
|
|
|
|
Try store not objects, but pointers:
<br />
<br />
class b;<br />
class a<br />
{<br />
b* pObja;<br />
}<br />
<br />
<br />
class a;<br />
class b<br />
{<br />
a* pObja;<br />
}
|
|
|
|
|
My friend and I are working on a game that will be put on web as a shareware, much like the original Doom. However, how do we generate a CD-key everytime a customer register? Anyone has done this before?
Thanks
-----------------------------
C++ without virtual functions is not OO. Programming with classes but without dynamic binding is called "object based", but not "object oriented".
|
|
|
|
|
Try looking for "software dongle" in google. There are some free stuffs in there.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
Dear programmers,
I am capturing audio PCM with 8-bit and 16-bit from DirectSound.
As you see below zero values are 128 for 8-bit and 0 for 16-bit.
BITS VALUE RANGE ZERO VALUE
---- ----------- ----------
8-bit 0 to 255 128
16-bit -32768 to +32767 0
Recently, I examined captured audio data sream for both 8 and 16 bits and I notify a strange result.
When I capturing 8-bit audio the audio signal is oscilation near the 0x80 (128). It is OK.
But, when I capture 16-bit audio PCM; the data is oscilating periodically from 0 to 0xffff. I copy/paste below 22050 KHZ 16-bit MONO audio PCM which is captured from microphone[ there is no high volume noise or sound source while recording]. The PCM data is consist of only air & EM noise. But there are peaks near the 0xFFFF, it is not normal. What may cause to this high amplitude audio peaks.
I tried this with two different SoundBlaster but nothing has changed.
What may offer you.
Thanks and best regard.
ff f0 (peak)
00 14
00 1e
ff eb (peak)
00 16
00 2c
ff f8 (peak)
00 1a
ff fe (peak)
00 11
00 07
ff e4 (peak)
00 13
00 04
ff ea (peak)
00 0c
00 40
00 2d
00 15
00 15
00 08
00 1b
00 0c
00 0e
00 1d
ff ff (peak)
|
|
|
|
|
I need to load a csv file into mdb in my code.
I think the fastest way to do it is using bulk update of records, but although the msdn indicates it is possible to update bulk rows of data using SQLSetPos,I can't find an example of such code.
Can any one help ?
|
|
|
|
|
|
Hello everyone,
An error occur when I debug the follow codes,please help me tofind the errors,Thanks!
DDSURFACEDESC2 ddsd;
LPDIRECTDRAWSURFACE4 g_pDDSBack = NULL;
//DirectDraw back surface
HRESULT hRet;
memset(&ddsd, 0, sizeof(ddsd));
ddsd.dwSize = sizeof(ddsd);
ddsd.dwFlags= DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH |
DDSD_PIXELFORMAT | DDSD_BACKBUFFERCOUNT;
ddsd.ddsCaps.dwCaps = DDSCAPS_OVERLAY |
DDSCAPS_VIDEOPORT |
DDSCAPS_SYSTEMMEMORY|
//DDSCAPS_VIDEOMEMORY |
DDSCAPS_FLIP |
DDSCAPS_BACKBUFFER |
DDSCAPS_COMPLE
FALSE;
ddsd.dwBackBufferCount = 1;
ddsd.dwWidth =g_SurfWidth;
ddsd.dwHeight =g_SurfHeight*g_Factor;
ddsd.ddpfPixelFormat.dwFlags = DDPF_FOURCC;
ddsd.ddpfPixelFormat.dwFourCC=mmioFOURCC
('Y','U','Y','V');
Line1:
hRet = g_pDD->CreateSurface(&ddsd, &g_pDDSBack, NULL);
Note :
g_pDD is a created LPDIRECTDRAW4 vairable
Add I have checked the value of g_pDD.
It's not zero!
g_SurfWidth,g_SurfHeight,g_Factor are all initialzed!
but When I excute the program g_pDDSback is zero!
why?
Is there some errors at the setting of ddsd?
free like a bird
|
|
|
|
|