|
RealityGamma wrote:
...and my current working directory isnt my desktop...
How are you verifying this?
As has already been mentioned, if you do not specify an absolute path, a relative path is assumed.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I am trying to change an ISAPI Extension so it uses Thread Pooling.
I've downloaded the sample from Microsoft and able to get it running.
The problem I am encountering has to do with the AfxBeginThread
function and a Runtime Class. I don't know how to let the class know
how to pass any parameters through the UI thread.
The unconverted ISAPI Extension uses this call:
CClientSession* pWinThread =
(CClientSession*)AfxBeginThread(RUNTIME_CLASS(CClientSession));
Whereas the sample uses:
CWinThread* pWinThread =
AfxBeginThread((AFX_THREADPROC)ThreadProc, m_hIoPort);
Note the MS Example AfxBeginThread uses the ThreadProc overload, the
existing project however uses CClientSession, which inherits from
CWinThread.
How can I let the CClientSession thread know about m_hIoPort the I/O
Completion Port?
<signature>
It's good to live,
Josef Wainz
Software Developer
|
|
|
|
|
The AfxBeginThread function has a parameter called dwCreateFlags . Set the value of that parameter to CREATE_SUSPENDED , set any of the threads member variables to whatever you want then call CWinThread::ResumeThread to run the thread.
"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
|
|
|
|
|
Hi all,
can anyone tell me if it is possible to automate MS Access so that I can perform the following tasks from my C++ application:
Open Access
Create a new database
Add a table
Add columns to table
Add data to table
Close table
Close database
I've done similar things for Excel and PowerPoint but can't find any examples on how to do this for Access (I've got as far as getting Access to open, but that is it).
many thanks,
Andy
|
|
|
|
|
Using Automation, just add classes from the msacc9.olb type library. Is there some reason why you can't use ODBC? One of its benefits is that Access is not required to reside on the target machine.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
thanks DavidCrow,
unfortunately the program we are coding has a lot of legacy code and libraries in it which clash with a lot of new libraries. We have found that we can use the automation features in Office which don't cause these clashes.
I've already added the type library however I'm not sure the order in which I create the various objects and also what (if any) parameters I need to pass into their constructors. If you could give me any guidance on this it would be most helpfull.
cheers,
Andy
|
|
|
|
|
Unless you are needing something specific from Access (e.g., form, query, report), I think it would be easier to use DAO. Look in the C:\Program Files\Common Files\Microsoft Shared\DAO folder for the type library. Unfortunately the only example I could put together is in VB.
It's helpful to use VB's Object Browser and the C:\Program Files\Common Files\Microsoft Office\Office\1033\Acmain9.chm help file for figuring out classes and objects from the type library.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Yes these are all possible. There are some good articles with ADO classes to facilitate this by Carlos Antollini in the database section.
|
|
|
|
|
I'm trying to load a .db file as a custom resource and then write it out at runtime. I can load the .db and get a resource id and it builds fine, but can't figure out how to write the file out at runtime.
Is this even possbible?
Thanks in advance,
Ron
|
|
|
|
|
Some months ago I used this code to write a resource to a file:
FILE *outfile;
if (outfile = fopen(OutDLL, "wb"))
{
fwrite(dll, 1, dll_size, outfile);
fclose(outfile);
}
dll is a void* -pointer to the resource, dll_size the size of the resource
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Thanks,
What I don't understand is how to address the resource. For example, I have a resource ID IDR_DB that I loaded at design time. How do I read it so as to write it to a file.
Thanks for help,
Ron
|
|
|
|
|
rlepine wrote:
Is this even possbible?
Yes. See here for an example.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Appears to be just what I needed.
Thank you very much,
Ron
|
|
|
|
|
hi
What do I have to do to maintain the layout of a Form when I maximize the window?
Is it possible to desig the GUI working in a window that is 50% smaller than the final GUI and configure the window to maximize when executing such that all the containers in the form maintain its position in relation to the borders AND resizes. (i.e. if I maximize the window from 50% to 100& I want all the containers to double in size as well)
doneirik
|
|
|
|
|
(assuming you're using MFC/win32 UI code )
you need to handle the resizing of the UI manually, handle the WM_SIZE message and resize and reposition each control.
or you could use a layout manager, have a look here at CP for different layout managers.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
|
Hi all,
i need your help urgently.
i am facing problem with posting a DoModal FileOpenDialog from property sheet. i will explian my problem this way.
I hava a dialog D1 derived from CDialog. in its OnInitDialog(), i created a propertysheet PS1 at run time with D1 as parent, and PS1 having WS_CHILD | WS_VISIBLE as creation styles. PS1 has 2 propertypages - PP1, PP2 - added to it. PP1 has OPEN button. On Clicking OPEN, i need to post FileOpenDialog Box. My code is as below:
D1.cpp
-------
BOOL CD1::OnInitDialog()
{
CPropertySheet *PS1;
PS1 = new CPropertySheet("", this, 0) ;
CPropertyPage *pp1 = new PP1() ;
CPropertyPage *pp2 = new PP2() ;
PS1->AddPage(pp1) ;
PS2->AddPage(pp2) ;
PP1->Create(this, WS_CHILD | WS_VISIBLE) ;
PP1->ShowWindow(1) ;
}
PP1.cpp
void PP1::OnBtnOpen()
{
CString fileName ;
char charFilter[256] ;
char fileExt[100] ;
char *filename ;
strcpy(charFilter, "File Filter (.mmm)|*.mmm|") ;
strcpy(fileExt, "mwf") ;
CFileDialog fileDialog(TRUE, // Open File Dialog
fileExt, // default extension
NULL, // Initial File Name
OFN_HIDEREADONLY |
OFN_OVERWRITEPROMPT |
FILE_ATTRIBUTE_DIRECTORY,
charFilter, // File Filters
AfxGetMainWnd() ); // Parent Window
if( fileDialog.DoModal() == IDOK )
{
return ;
}
}
my application hangs at fileDialog.DoModal().
Please help me in rectifying it.
|
|
|
|
|
Sreenivasa.Murthy.G wrote:
strcpy(charFilter, "File Filter (.mmm)|*.mmm|") ;
filter always end by Double | operator i.e. ||.
this may be causing the problem.
right way to write charFilter is
strcpy(charFilter, "File Filter (.mmm)|*.mmm||") ;
"I Think this Will Help"
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
How can I detect resource leaks in my VC code. There are several articles on CodeProject which addresses the memory leak detection however I couldn't find any about resource leak detection. Any ideas?
|
|
|
|
|
How are you confirming that resource leaks are happening?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
|
|
I have a Windows application programmed in C (SDK level) using VC6. My Windows 98 and Windows XP (on different PCs) are set up with task bar "Always on top" & "Auto-hide".
With my application window having the focus and maximised, the task bar pops correctly in Win98 when I bring the mouse pointer to the bottom of the monitor, but on XP, the task bar does not popup.
I register the window as:
memset(&wc,0,sizeof(wc));<br />
wc.style = CS_BYTEALIGNWINDOW | CS_VREDRAW | CS_HREDRAW | CS_DBLCLKS;<br />
wc.lpfnWndProc = MainWindowProc;<br />
wc.cbClsExtra = 0;<br />
wc.cbWndExtra = 0;<br />
wc.hInstance = hAppInst;<br />
wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);<br />
wc.hCursor = LoadCursor (NULL, IDC_ARROW);<br />
wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);<br />
wc.lpszMenuName = NULL;<br />
wc.lpszClassName = szAppName;<br />
<br />
RegisterClass (&wc);
and I create the window as:
hwndPrimary = CreateWindow(szAppName,
szPrimaryTitleBar,<br />
WS_POPUP | WS_BORDER,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
NULL,
NULL,
hAppInst,
NULL);
and then do:
ShowWindow(hwndPrimary,sw);<br />
<br />
ShowWindow(hwndPrimary, SW_MAXIMIZE);
Note - I use window style WS_POPUP | WS_BORDER because I need maximum size client area. I can't waste space on title bar, thick border, etc.
If I do not maximise the window, the task bar pops up just fine, but the moment the application is maximised (which I need to do), the task bar does not pop up properly. The problem only occurs under Windows XP. When I run the EXE under Win98, the task bar pops up as expected.
Any suggestions?
|
|
|
|
|
Statically linking a project includes all code in dll into exe file, so the dll is no more needed on target machine, how can we do same fo activex controls, ie linking or using in such a way that they are included in exe and no more need for installing/registring on target machines?
|
|
|
|
|
Dll are never statically linked to an exe !! Lib files are statically linked but dll never (a lib file is the same that a dll file, except that here the linkage is static and with a dll the linkage is dynamic).
So, for activeX, you cannot statically link them to your project. You need to install and register them if you want to use them on a target machine.
|
|
|
|