|
Goto your CRecordset::DoFieldExchange member function.
Enlarge the buffer for text field exchange like:
RFX_Text(pFX, _T("[REMARK]"), m_REMARK,1000);
adjust the numer "1000" to your max characters of the corresponding field.
I remember the default max length for text field is 255, you would get the truncate error message if data length exceed it.
|
|
|
|
|
Anyone, help pls !!! Can I use a .dll file if I don't have the .h file ?
I saw some discutions on this subject, where it says that it is possible to generate the .lib file from a given .dll. OK, but then how could I know what are the parameters of the functions exported by that .dll ?
|
|
|
|
|
http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B131313[^]
I seem to remember steps for doing this being available at the SQLite web site also, may wanna check that place out in the FAQ or something...I just quickly looked and couldn't find it, but i'm sure something is there about how to do this...however i'm not sure about the header file...
HTH
I wonder if there are any animals that actually have to think in order to breathe? It would really suck to be them!!!
|
|
|
|
|
Thx, the article from microsoft is enough for me ... But what about those freakin' animals ?
Q: why a blonde died when her headphones were removed ?
A: cause she was hearing: now inhale, now exhale, now inhale, now exhale ...
|
|
|
|
|
Hi guys,
I have been trying to resolve this for a couple of days already. I hope someone out there will be able to help me out here.
Introduction:
I created a "wrapper" executable, which "implements" interface required to be run as windows service. This executable has set of configuration files, which are used to prepare environment and define another binary to be run as a service.
So the wrapper - during its own start-up - creates a new process from those configuration files.
Problem:
The starting and stopping works fine, but when I start the service from some user context (Administrator) and then I log off, the child process is being killed and my service wrapper detects that and stops.
The service configuration uses LocalSystem as the user context.
The weird part is that if I do this through a RDP connection, the child process stays alive even after logoff.
Snippet:
memset(&si, 0, sizeof(STARTUPINFO));
si.cb = sizeof(STARTUPINFO);
si.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW;
si.wShowWindow = SW_HIDE;
si.lpDesktop = "";
si.hStdOutput = hChildStdOut;
si.hStdInput = hChildStdIn;
si.hStdError = hChildStdErr;
BOOL ok = CreateProcess(NULL, lpszCmd, NULL, NULL, TRUE, // handles inherited
CREATE_NEW_CONSOLE | CREATE_NEW_PROCESS_GROUP , NULL, lpszPath, &si, piProcInfo);
Thanks in advance,
Peter
|
|
|
|
|
I think because you are creating your program attached to the current users's desktop, when the user logs off, your main window is terminated because the desktop is destroyed. Isn't there a hidden desktop that the services use? Perhaps you should attach to that instead.
|
|
|
|
|
Hi Blake,
thanks for your response...
You're probably referring to this part:
si.lpDesktop = "";
I tried to use lpDesktop with NULL value as well, and the child process was supposed to inherit the desktop from the parent process. However that did not work either...
Thanks,
Peter
|
|
|
|
|
What I meant was that the lpDesktop would NOT be NULL or EMPTY. It needs to be set to the name or handle of the desktop where the services are run. Any windows started on the desktop of the user are going to recieve all sorts of messages about termination when the user logs off.
It is best, if possible, to write services that have NO USER Interface whatsoever. Interact with them via TCP/IP, local RPC, DCOM, memory mapped files, service control commands, etc. Anything but windows!
|
|
|
|
|
Yes - I understood it correctly.
I was just saying that if you initialize STARTUPINFO.lpDesktop with NULL value desktop will be inherited (that's from MSDN).
So if the process which creates this child process is a service (that is my case), they should be on the same desktop, am I right?
My service has no user interface - it's plain process, which listens for the requests...
Thanks again,
Peter
|
|
|
|
|
I added a code, where I am quering the desktop of the current thread (running service wrapper) and retrieving its name. Then I used the retrieved desktop name for the new child process creation. It did not help. And the desktop name value retrieved in the code was "Default", which is weird I think...
code fragments:
HDESK hDesk = GetThreadDesktop(GetCurrentThreadId());
GetUserObjectInformation(hDesk, UOI_NAME, lpszDesktopName, ...);
...
si.lpDesktop = lpszDesktopName;
...
CreateProcess(..., &si, ...);
Thanks,
Peter
|
|
|
|
|
I am sorry now, I do not know what else to suggest
|
|
|
|
|
I read an interesting article about a logon session broker written by K.Brown published @ MS site:
http://www.microsoft.com/msj/0200/logon/logon.aspx[^]
So I have done one more test and I used
Service-0x0-3e7$\\Default
as a value for DesktopName in STARTUPINFO, but it did not help either. My child process still dies after session log-off.
Thanks,
Peter
|
|
|
|
|
Hi,
I'm having a nightmare with argument passing using OLE automation.
I have created an automation DLL using Visual C++. it's to be used in VB. I want to create a function within this DLL which accepts an array of object as argument. I know how to do that for a single object using the LPDISPATCH argument type but now what if I want an array of this object? I have tried many solutions but none of them worked...
I hope someone will be able to help me!
Jeff
|
|
|
|
|
I wrote a regular MFC dll which should display a dialog-box.
I have a class derived from CDialog to display my dialog.
Now, my exported class is a regular one (NOT MFC) which has a method Open to open the dialog.
(I use a regular class since my client is a console application or none-MFC client)
The problem is that i get assert on AfxGetResourceHandle().
When i added the statement "AFX_MANAGE_STATE(AfxGetStaticModuleState( ));"
i got a link error saying:
"mfcs42d.lib(dllmodul.obj) : error LNK2005: _DllMain@12 already defined in RewinderSimulator.obj
mfcs42d.lib(dllmodul.obj) : error LNK2005: __pRawDllMain already defined in RewinderSimulator.obj".
How can i solve my problem?
Thanks,
Dudi
|
|
|
|
|
I would like to clip one region from another. But how to get points array from HRGN????
|
|
|
|
|
Have a look at CRgn::GetRegionData() .
"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!
|
|
|
|
|
I wrote a little COM dll, that placed on one machine, and client programm on another. The machine where com dll is placed - wiht Windows XP, and client program works properly if it on WIndows XP, and doesn't work if it on Windows 2000 Proffessional or Server, i haven't tried it on another OS. What's wrong am i doing? It shows the messagec "Invalid pointer".
|
|
|
|
|
My first guess would be a missing or unregistered DLL that is used by your DLL.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
But how can it be??? I just call the dll from another computer....
As i said on the Windows XP the client programm works, but on another platform doesnt.
As i understand the DCOM - it should make a connection throught the net, and call the methods of my COM. So, may be deal in ports??? which ports used DCOM? - i've never seen that information...
Or maibe i shoud make the instance of My com another way than CoCreateObject???
|
|
|
|
|
open dilaog after 15 years does not work propertly.
Do a simple app. Make it enter MTA.
Pop up a Common Open/Save File Dialog.
On Win2K Hangs When Selecting topmost My Documents Folder.
On Win XP, By selecting my computer the list view is empty.
On both OS-es sometime list of files is chopped (if does not hang meanwhile).
I would apreciate any workaround.
But after 15 years they could not get it right a ... so common open dialog...
|
|
|
|
|
around.:
[code]
class COd : public CFileDialog
{
public:
COd(BOOL bOpenFileDialog,
LPCTSTR lpszDefExt = NULL,
LPCTSTR lpszFileName = NULL,
DWORD dwFlags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT|OFN_PATHMUSTEXIST,
LPCTSTR lpszFilter = NULL,
CWnd* pParentWnd = NULL):CFileDialog(bOpenFileDialog,
lpszDefExt ,
lpszFileName ,
dwFlags ,
lpszFilter ,
0 )
{
}
int DoModal(){
return CFileDialog::DoModal();
}
BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult)
{
BOOL ret = CFileDialog::OnNotify(wParam, lParam, pResult);
OFNOTIFY* pNotify = (OFNOTIFY*)lParam;
switch(pNotify->hdr.code)
{
case CDN_TYPECHANGE:
{
CWnd* pWnd = GetActiveWindow();
CWnd* PDlg = pWnd;
if(pWnd)
{
GetFocus()->PostMessage(WM_KEYDOWN,VK_RETURN,0);
GetFocus()->PostMessage(WM_KEYUP,VK_RETURN,0);
}
}
break;
}
return ret;
}
virtual void OnFolderChange()
{
TCHAR cs[128];
CWnd* pWnd = GetActiveWindow();
CWnd* PDlg = pWnd;
CWnd* PSlv = 0;
int relation = GW_CHILD|GW_HWNDFIRST;
while(pWnd = pWnd->GetWindow(relation))
{
GetClassName(pWnd->m_hWnd, cs,128);
if(!strcmp("SHELLDLL_DefView",cs))
{
CWnd* pSave = pWnd;
int relation = GW_CHILD|GW_HWNDFIRST;
while(pWnd = pWnd->GetWindow(relation))
{
GetClassName(pWnd->m_hWnd, cs,128);
if(!strcmp("SysListView32",cs))
{
PSlv = pWnd;
break;
}
relation = GW_HWNDNEXT;
}
pWnd = pSave;
}
relation = GW_HWNDNEXT;
}
}
};
class DlgWrap
{
public:
DlgWrap(BOOL bOpenFileDialog,
LPCTSTR lpszDefExt = NULL,
LPCTSTR lpszFileName = NULL,
DWORD dwFlags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT|OFN_PATHMUSTEXIST,
LPCTSTR lpszFilter = NULL,
CWnd* pParentWnd = NULL)
{
memset(&m_ofn,0,sizeof(m_ofn));
_cfilter = lpszFilter;
_cfilter.Replace('|', '\0');
m_ofn.lStructSize = sizeof(m_ofn);
m_ofn.lpstrDefExt = lpszDefExt;
m_ofn.lpstrFile = (LPTSTR)lpszFileName;
m_ofn.Flags = dwFlags ;//| OFN_EXPLORER;
m_ofn.lpstrFileTitle = "asdfasd";
m_ofn.lpstrFilter = (LPCTSTR)_cfilter ;
/*
m_ofn.nMaxFileTitle = MAX_PATH;
m_ofn.hwndOwner = pParentWnd->m_hWnd;
m_ofn.lpstrFilter = lpszFilter;
*/
//// m_ofn.Flags = dwFlags | OFN_EXPLORER;
//// strFilter.Replace('|', '\0');
}
UINT DoModal()
{
_hThread = ::CreateThread(0,0,(LPTHREAD_START_ROUTINE)ThrProc,this,0,0);
Sleep(1208);
WaitForSingleObject(_hThread, INFINITE);
return _rv;
}
static UINT ThrProc(void* pThis)
{
OPENFILENAME ofn = {0};
DlgWrap* pDlg = (DlgWrap*)pThis;
HRESULT hr = CoInitialize(0);
memcpy(&ofn, &pDlg->m_ofn, sizeof(ofn));
pDlg->_rv = ::GetOpenFileName(&ofn);
memcpy(&pDlg->m_ofn, &ofn, sizeof(ofn));
CoUninitialize();
return pDlg->_rv;
}
DWORD _rv;
HANDLE _hThread;
OPENFILENAME m_ofn;
CString _cfilter ;
};
[/code]
|
|
|
|
|
I need to disable a CListCtrl item, and can't find out how. It looks like SetItemState() will do it, but I can't find what to set. Any help? Thanks
BW
The Biggest Loser
"Farm Donkey makes us laugh. Farm Donkey hauls some ass." -The Stoves
|
|
|
|
|
I don't think you can actually change an items state to disabled with a default CImageList. You may want to look at some custom control imagelists here on CP, cuz i'm sure you'd have to atleast do some custom drawing.
I wonder if there are any animals that actually have to think in order to breathe? It would really suck to be them!!!
|
|
|
|
|
I don't think you can actually change an items state to disabled with a default CImageList. You may want to look at some custom control imagelists here on CP, cuz i'm sure you'd have to atleast do some custom drawing.
I wonder if there are any animals that actually have to think in order to breathe? It would really suck to be them!!!
|
|
|
|
|
Is there a way to label objects after edge detection? the border of the object is well linked together to formed a closed boundary. ANyone with an algorithm to do this. Please send to me.
|
|
|
|
|