|
Hi all,
I have a win32 dll workspace. In this workspace i have most of the files as .c files. I want to export one of the function from this dll. The function is a static function. so for that function if i export it in this way
__declspec(dllexport) static rdiff_sig(const char *BasisPath, const char *SigPath);
i am getting one error message as below.
error C2201: 'rdiff_sig' : must have external linkage in order to be exported/imported
What should i do to solve this problem.
Thanks
Datta K.
|
|
|
|
|
I'm not an expert in C programming but I think that declaring a global function as static means that it is only accessible from within that file. Did you try what your compiler told you ? That is specify the function as extern (put the keyword extern in front of it) ?
|
|
|
|
|
I want the caption bar buttons(i.e,mim,max,and close) to be removed completely.Is it possible.
|
|
|
|
|
remove them from the system menu of your application...
|
|
|
|
|
Thanks.I have another question can we replace these by bitmap buttons with same features.Because i have added gradient color to the title bar and now look of these buttons is not good on the title bar.so only i want to remove these buttons.And i want to add bitmap buttons in their place.Is my approach good or can we modify look of existing buttons on the title bar.
|
|
|
|
|
|
Hi,
From a CPP program, I am creating a service. And from that service I am invoking an exe with CreateProcess function. The problem here is that, when that service is started locally then the exe's GUI is visble. But if the service is started from the machine thru remotedesktop connection, the exe's GUI is not visible. But I can see the exe process in task manager.
Please help me in this regards.
Thanks in advance.
Surendran
|
|
|
|
|
Hi,
If it is a service, then it is executed in local session, which is different from the one that you're operating.
You have to attach your service desktop to the one you're going to display GUI on. AFAIK, there's no way to attach your GUI to something like "global" desktop so it would be visible for all. Only one desktop can be attached at once.
I suggest, creating GUI as client app and use IPC to speak with your service. This way, your GUI may have access to the service from multiple desktops at once. use sockets, shared memory or pipes for IPC (shmem or pipe should be created in global namespace).
Regards
|
|
|
|
|
sir,
I want to invoke active-x control method.
The object for which is getting created on use of methods(CoGetClassObject , RequestLicKey ,CreateInstanceLic), but i couldn't able to invoke methods of Active-x control.
Here is the code which explains the problem. please suggest me for further action.
void CContainerView::OnRButtonDown(UINT nFlags, CPoint point)
{
IClassFactory* pclsf;
IClassFactory2* pclsf2;
IUnknown* pUnk;
ICalendar* pmydll;
BSTR lickey;
//for mmcontour clsid
static CLSID const clsid = { 0x621464c0, 0x5e90, 0x4da2, { 0x9a, 0x6b, 0x9b, 0x7f, 0xdd, 0x31, 0x91, 0x98 } };
//get the IClassFactory Interface pointer
IDispatch *pDisp = NULL;
HRESULT hr = CoGetClassObject(clsid,CLSCTX_INPROC_SERVER,NULL,
IID_IClassFactory,(void**)&pclsf);
hr = pclsf->QueryInterface(IID_IClassFactory2, (void**)& pclsf2);
if (FAILED(hr))
pclsf->Release();
IMmContrs *pObj;
//To get License key
hr = pclsf2->RequestLicKey(20,&lickey);
//To create instance of object using License key
HRESULT hr2 = pclsf2->CreateInstanceLic(NULL,NULL, IID_IOleObject ,
lickey, (void **)&pObj);
TRY
{
BOOL blTitle;
//Getting Following Error on Execution of methods in MMContour :
//Unhandled exception at 0x78303ba4 (mfc80d.dll) in Container.exe: //0xC0000005: Access violation reading location 0x00000000.
blTitle=pObj->AboutBox();
}
CATCH_ALL(e)
{
THROW_LAST();
}
END_CATCH_ALL
//finally
//{
pclsf2->Release();
}
waiting for your reply.
regards,
praveen A.
praveena@navayuga.co.in
praveen kumar agarwal.
|
|
|
|
|
Hi,
It seems that pObj is not created.
Are you certain that this ActiveX control does contain runtime license key? You should check for its availability with GetLicInfo . One of the members of LICINFO structure, fRuntimeKeyAvail, does specify if such license can be obtained, by using RequestLicKey. If there's no runtime license, you have to provide license key, manually.
Also, check hr2 for errors, when creating instance.
Regards
|
|
|
|
|
I am able to get license key. the active-x control is getting instantiated. But problem is with invoking method/properties of the control. I get access violation error.
regarding hr2, it is returning S_OK.
Thanks & Regards,
Praveen A.
|
|
|
|
|
I am working on a C++ class project in MSVC. I have declared:
class Node
{
private:
.
.
.
public
.
.
.
};
now in a separate file, I want to declare:
class Employee
{
private:
Node alphabetagamma; // for example
.
.
public:
.
.
.
};
When I do this I get compile time errors indicating that the compiler does not recognize "Node" as a type of object. I am including the header files correctly in my implementation (.cpp) files. What am I forgetting?
Thanks,
Geoff
-- modified at 5:02 Friday 1st December, 2006
|
|
|
|
|
Spherelin wrote: I am including the header files correctly in my implementation (.cpp) files
If you declare an instance of Node in your header file, then you need of course to include the header file of Node in thie file also (otherwise, the class Node is not recognized).
|
|
|
|
|
okay thanks - that fixed it!
hey so if I am entering a number via a statement like:
cin >> selection
how do I clear cin for the next use.
basically, user is going to enter a number (text entry program...for now). and then the next entry is going to be characters - like a name or state.
Right now, it seems to take the strike of the return key as the second entry.
THanks,
G
|
|
|
|
|
Dear All,
I am doing a project , which is an MFC application (MDI)
. Now its a standalone application with MS Access as the "Back end". I
have used ADO to made the connection.
Now I want to make this application to work for several clients
at the same time . I also want this application to communicate with 3
different types of Database .
1) MySQL
2) MS SQL Server
3) Oracle
My application should connect with any of the above DB , without making
any problem..
Can I make a general implementation by using ADO ?
What are the precautions I have to take to implement this ?
I think ,I have to face the problems of "concurrent write/reads " to
the DB...How can I overcome this ?
Now I am using Multiple SQL queries for multiple table updations.
Whether I can use transactions to avoid data loss during multiple table
updations...?
But I think MySQL won't support transactions...Is there any other
option?
Can any one pls give me a suggestion ...?
Thanks in advance...
vinsankar
|
|
|
|
|
Hi,
MySQL DO support transactions. Never doubt in a free software, just because it's free.
Using transactions is exactly what you need to handle concurrent access.
Regards
|
|
|
|
|
Hi,
Galatei wrote: MySQL DO support transactions. Never doubt in a free software, just because it's free.
Thanks for correcting me...
I have no doubt over the power of MySQL .
But Is there any other issues I have to handle to implement the Client/Server technology ?
Whether I can port my existing application (uses ADO with ACCESS) to the above implementation without spending much time for development ?
Is there any useful books or articles I have to read before designing it?
Thanks in advance...
vinsankar
|
|
|
|
|
I want to paste the same file version to many files in the "File" table of .MSI file using ORCA tool. But I can paste in a single cell only. I want to paste in multiple cells at a time. I hope somebody knows how to do. Becuase, it is difficult to paste in each cell if there are lot of files.
Thanks in Advance!
Suman
|
|
|
|
|
I used the Windows API function GetPrinterDriver() for getting the .ppd file for a specified printer. But for some printers this function is returning a .pdf file instead of .ppd file. can anyone help me to solve this and get a ppd file not pdf file. the following is the code i have written.
Note: In the following code. Only for printer named RIO-219 the Driver Name I am getting is .pdf file , for all others i am getting .ppd files.
void CPrinterDriverInformationDlg::OnBnClickedBtnPrintinfo()
{
// TODO: Add your control notification handler code here
HANDLE hPrinter;
CString strDriverName;
CString strDriverPPDFile;
DWORD dw;
DRIVER_INFO_4* pDriverInfo;
int index = 0;
// The following are the list of printers installed in my system.
const LPWSTR printerTbl[] =
{
L"Rio-219",
L"k2-212",
L"Den-203",
L"gl1010",
L"Hud-224",
NULL
};
while (printerTbl[index] != NULL)
{
if (OpenPrinter(printerTbl[index], &hPrinter, NULL))
{
if (! GetPrinterDriver(hPrinter, NULL, 4, NULL, 0, &dw))
{
BYTE* p = new BYTE[dw];
GetPrinterDriver(hPrinter, NULL, 4, p, dw, &dw);
pDriverInfo = (DRIVER_INFO_4*) p;
strDriverName = pDriverInfo->pName;
strDriverPPDFile = pDriverInfo->pDataFile;
delete [] p;
}
ClosePrinter(hPrinter);
}
++index;
}
}
thank you
|
|
|
|
|
how to retrieve URL's of opened browser windows?
|
|
|
|
|
hi,
One way i had tried out. Please follow the steps.
1. Enumerate all Destopwindows(Parent is Null)
2. Check the class Name of the window is "CabinetWClass" or "IEFrame"
3. If it is so and the browser is having only one window ie url edit window
then enumerate the child windows of the current window till u recive an edit window and the get the required text.
Like this i tried and got it. If u require any code i can post u later.
Thank you,
Manu
Manu
|
|
|
|
|
plz gimme some more detailed explaination or code..
Anyway thanks for replying me...
|
|
|
|
|
//[
BOOL CALLBACK EnumChildProc(HWND hwndChild, LPARAM lParam)
{
long lIDChild=0;
char szClasName[_MAX_PATH]={0};
::GetClassName(hwndChild, szClasName,50);
if (strcmp(szClasName,"Edit") ==0) //The Url Edit window (Assumed)
{
char szUrl[_MAX_PATH];//Url String
memset(szUrl, 0, _MAX_PATH);
::SendMessage(hwndChild, WM_GETTEXT, _MAX_PATH, (LPARAM)szUrl);
}
lIDChild = GetWindowLong(hwndChild, GWL_ID);
return TRUE;
}
BOOL CALLBACK EnumProc( HWND hwnd, LPARAM lParam )
{
char szClasName[_MAX_PATH];
DWORD dwThreadId;
HDESK hdesk;
dwThreadId = GetWindowThreadProcessId( hwnd, NULL );
memset(szClasName, 0, _MAX_PATH);
::GetClassName(hwnd, szClasName,50);
if ( (strcmp(szClasName, "CabinetWClass")==0) || (strcmp(szClasName, "IEFrame")==0) )//Explorer or IE window
{
EnumChildWindows(hwnd, EnumChildProc,(LPARAM) NULL); //Enumerate through its child windows
}
hdesk = GetThreadDesktop( dwThreadId );
if( hdesk && hdesk != (HDESK)lParam )
return FALSE;
return TRUE;
}
//]
void CWindTestDlg::OnOK()
{
HDESK hdesk;
hdesk = GetThreadDesktop( GetCurrentThreadId() );
EnumDesktopWindows( hdesk, EnumProc, (LPARAM)hdesk );
return;
}
Just try this. all the best,If any problems please let me know
Manu
|
|
|
|
|
I have a command "regsvr32 "c:\temp\temp.dll", I am executing that in my program by WinExec API, but that API only returns the result that it has executed application "RegSvr32.exe" or not, but i don't get the complete result i.e "regsvr32 "c:\temp\temp.dll" i.e temp.dll has been register sucessfully or not, any hint to get the complete result of a child process.
Warm Regards,
Mushq
|
|
|
|
|
You need to use CreateProcess instead.
It will give you a process handle in one of the structures you pass it.
If CreateProcess returns successfully, WaitForSingleObject the process handle (assuming you are not in a GUI thread) and then call the magic api function GetExitCodeProcess. Oh - and don't forget to CloseHandle on the returned process and thread handles.
HTH
Mike
|
|
|
|
|