|
I made a COM (dll) server, i hope it will work in the local
network as a DCOM , because i haven't tried it yet. So it
is three tier Database Architecture, the client programm
sends a query to the server programm ant it sends a CSV
formated data.
The first question - i tried to use ADO (_Recordset) - as
return parameter, but had error in the IDL file, i didn't
know how to avoid it, and i changed it to IUnknow, but in
the client programm i couldn't dispatch it: i did this:
In The Client:
_Recordset* pRecordset = pDatabase->GetMaterials();
ANd it ruturns 0 = WHY???
In The Server:
GetMaterials(IUnknown* pRecordset)
{
_RecordsetPtr p(__uuidof(_Recorset))
//Some Query Procedure
//And in the finish
_RecordsetPtr->QueryInterface(__uuidof(_Recordset),(void**)
&pRecordset);
return S_OK;
}
And Another Question.
Server Should be able to change the address of Database.
For example now = the addres is C:\econ.mdb;
but if the database in other place?
I tried to use GetModulFileName() - but it returned -
C:\Windows\System32\Svchost.dll.
The Main question is - how to find out where my dll
placed...
Thanks.
|
|
|
|
|
hey,
How to make a slider control's thumb moverment freeflow. Currently the slider thumb taking fixed range jumps to reach the clicked channel position. I need the thumb posion in the clicked region with in a single jump. pls help me.
Thanks in advance
shijuck
|
|
|
|
|
ok i am very new to working with dll files and just recently got a dll to compile and a program to compile and use the dll file.
i made a program to test my dll, in my dll i got functions defined that have variables defined that are returned and than used in another function in the same dll file. what i was wondering was how i can return those variables and get them to be used cause after i got through first function the program crashes.
not sure if its something to do with how i return the variables or not, if someone could help i would really appreciate it.
the more you learn the less you know, no one is truely a master. cause the more you seek to be the master the less of a master you become.
|
|
|
|
|
hey,
just came across this. don't know if you've figured it out yet but I'll help you out anyway.
Its hard for me to tell what is causing the problem without seeing some code, so I'll just give you a quick rundown of what you should be doing to make it run correctly. Some of this probably is obvious but I'll say it anyway.
Make sure every function in the dll that you are going to use has the dll export and import statements in your dll and main app. Secondly, for what you are saying, this is how it should work.
In the main application
temp variable = 1st dll function();
2nd dll function(temp variable);
That's all there is to it.
|
|
|
|
|
Hello,
I've built an app with the web browser component and print using ExecWB and the DONTPROMPTUSER option.
This works most of the time, but occasionally the print dialog does appear (say 1 in every 50 prints) This causes huge problems for my mouse-free operators.
Below is the code, problem occurs on Win XP.
hr = m_pBrowser->ExecWB(OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER, &vArg, NULL);
Any ideas? This has me baffled?
Joanne 
|
|
|
|
|
I had a weird problem just recently where: ExecWB( OLECMDID_PASTE, OLECMDEXECOPT_DODEFAULT, NULL, NULL ); didn't work on one users PC. I changed it to use the newer code in MFC7 afxhtml70.h and it solved the problem. This is in Surfulater (see sig).
I have no idea if this is related but I'd suggest trying the MFC7 CHtmlEditCtrlBase::PrintDocument().
Neville Franks, Author of ED for Windows www.getsoft.com and Surfulater www.surfulater.com "Save what you Surf"
|
|
|
|
|
What's in the vArg ? If it is not initialized properly, it may trigger some "prompt user" behavior. If it's not initialized explicitly, its contents will be random, which reflects your application's random behavior.
--
Weiter, weiter, ins verderben.
Wir müssen leben bis wir sterben.
I blog too now[^]
|
|
|
|
|
Thanks for the replies.
I am using the vArg to clear the header and footer so that the default Internet Explorer text does not appear on my printout.
It was a while ago, but I think this I got the code from a Codeproject article. Does it look ok to you?
I can't disable it to see if the problem goes away because its on a live manufacturing system and the problem never happens for me (of course)
Joanne
SAFEARRAYBOUND psabBounds[1];
SAFEARRAY *psaHeadFoot;
// Initialize header and footer parameters to send to ExecWB().
psabBounds[0].lLbound = 0;
psabBounds[0].cElements = 2;
psaHeadFoot = SafeArrayCreate(VT_VARIANT, 1, psabBounds);
VARIANT vHeadStr, vFootStr;
VariantInit(&vHeadStr);
VariantInit(&vFootStr);
// Argument 1: Header
vHeadStr.vt = VT_BSTR;
vHeadStr.bstrVal = SysAllocString(L"");
// Argument 2: Footer
vFootStr.vt = VT_BSTR;
vFootStr.bstrVal = SysAllocString(L"");
// SAFEARRAY must be passed ByRef
VARIANT vArg;
VariantInit(&vArg);
vArg.vt = VT_ARRAY | VT_BYREF;
vArg.parray = psaHeadFoot;
LONG rgIndices = 0;
SafeArrayPutElement(psaHeadFoot, &rgIndices, static_cast<void *="">(&vHeadStr));
rgIndices = 1;
SafeArrayPutElement(psaHeadFoot, &rgIndices, static_cast<void *="">(&vFootStr));
|
|
|
|
|
Setting the background color in response to WM_CTLCOLORBTN appears to have no effect because if you're not running a theme-aware OS, or running a theme-aware OS in classic mode, the button face covers the entire client area, so no background shows through. If you run XP in the default theme, the button has rounded corners, so a bit of the background will be visible.
--Mike--
LINKS~! Ericahist | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ | You Are Dumb
|
|
|
|
|
The WM_CTLCOLOR message requires that you return a HRUSH for the background color. SetBkColor() doesn't work here. I assume WM_CTLCOLORBTN etc. are the same.
Neville Franks, Author of ED for Windows www.getsoft.com and Surfulater www.surfulater.com "Save what you Surf"
|
|
|
|
|
WM_CTLCOLORBTN: only owner-drawn buttons respond to the parent window processing this message.
Note: This message is a request for the handle to the brush that the system needs to paint the background of the button.
// Example
case WM_CTLCOLORBTN:
// create bush or use precreated brush
return mybrush_handle;
INTP
|
|
|
|
|
yes I know about returning the brush, I'm just copying and pasting my WM_CTLCOLORSTATIC code into the WM_CTLCOLORBTN and it doesnt work.
wWw.KruncherInc.cOm
|
|
|
|
|
Is the button owner-drawn? Only owner-drawn buttons respond to WM_CTLCOLORBTN message.
INTP
|
|
|
|
|
Why does WM_CTLCOLORBTN not work, it doesn't respond to things like SetBkColor and such like WM_CTLCOLORSTATIC does. Whats up with that?
wWw.KruncherInc.cOm
|
|
|
|
|
Not even sure if the subject made sense. Anyway, I am trying to sort a linked list that contains a class. I thought overloading the operators would do it, but apparently not. Getting serious errors! The best way to describe is to see the code. here it is. Any help would be much appreciated.
#include <iostream>
#include <string>
#include <list>
#include <algorithm>
using namespace std;
class customerType{
public:
customerType (string f, string l, int acct){
first=f;
last=l;
accountnum=acct;
}
bool operator==(const customerType& right) const{
return (last==right.last);}
bool operator!=(const customerType& right) const{
return (last!=right.last);}
bool operator<=(const customerType& right) const{
return (last<=right.last);}
bool operator<(const customerType& right) const{
return (last<right.last);}
bool operator>=(const customerType& right) const{
return (last>=right.last);}
bool operator>(const customerType& right) const{
return (last>right.last);}
private:
string first;
string last;
int accountnum;
};
void main()
{ list<customerType> customerList;
customerType customer1("Joe","Schmoe", 9999);
customerType customer2("Moe","Ghoe", 11111);
customerType customer3("Loe","Adner", 4232);
customerType customer4("Roe","Boat", 4444);
customerList.push_front(customer1);
customerList.push_front(customer2);
customerList.push_front(customer3);
customerList.push_front(customer4);
cout<<customerList.size()<<endl;
//uncomment the line below for major errors!
// sort(customerList.begin(), customerList.end());
};
|
|
|
|
|
Had the same problem once. The standard sort() algorithm won't work with lists. I can't remember exactly why, something to do with iterators.
As a workaround, the list container has its own sort() function...
So change
sort(customerList.begin(), customerList.end());
- to -
customerList.sort();
and it should work.
Pssst. You see that little light on your monitor? That's actually a government installed spy camera. Smile and wave to big brother!
|
|
|
|
|
Work it did! So close but yet sooo far! Thanks a lot!!!!

|
|
|
|
|
If I wanted anti-aliased images in my listbox would it be best to use an XP manifest or a custom CImageLIst to render the ICONS/BITMAPS so the alpha channel is used???
I have read a few articles and it seems manifest would be the easiest way...but not compatible with anything other than XP.
When you use a manifest, does CImageList now use the alpha channel in a 32bit image???
I have read a few articles:
like this one[^]
That suggest Windows forms (assuming .NET something NOT MFC) Image lists have a bug which causes alpha channels to be ignored???
I'm looking for the easiest solution...so if manifest file does exactly what I need done (Basically my controls need to use the alpha channel when rendering cuz I hate the jaggies) then i'll use the manifest appraoch.
If the manifest causes alot of other problems, from which I can tell from the articles I have read here on CP seems to bugger up other controls, etc...then maybe i'll consider writting a custom CImageListXP class which renders any bitmap using alpha channels...plus I guess it could be used in 98, etc...which would be nice but not nessecary...
Does a manifest sound like something I should use or should I write a CImageList class???
If I should use a manifest can you point me to an article which guides me through it and doesn't cause any weird side effects on combobox drop downs, etc...?
Thanks
How do I print my voice mail?
|
|
|
|
|
Add Testbox as a contral var.
Add button event.
Use SetWindowTex() to change Testbox.
|
|
|
|
|
http://winprog.org/tutorial/controls.html
wWw.KruncherInc.cOm
|
|
|
|
|
Do I need to do something special to run a 16-bit program using CreateProcess. My function works with "cmd.exe" but when I call the 16-bit program I want to use, I get a stack overflow.
Thanks a ton!
Mike
Here's my code:
BOOL CGeneral::CreateGENLAMProcess()
{
PROCESS_INFORMATION myPI;
STARTUPINFO mySI;
BOOL bFuncRetn = FALSE;
// Set up members of the PROCESS_INFORMATION structure.
ZeroMemory( &myPI, sizeof(PROCESS_INFORMATION) );
// Set up members of the STARTUPINFO structure.
ZeroMemory( &mySI, sizeof(STARTUPINFO) );
mySI.cb = sizeof(STARTUPINFO);
// Create the child process.
bFuncRetn = CreateProcess(NULL,
"genlam.exe", // my program name
NULL, // process security attributes
NULL, // primary thread security attributes
TRUE, // handles are inherited
0, // creation flags
NULL, // use parent's environment
NULL, // use parent's current directory
&mySI, // STARTUPINFO pointer
&myPI); // receives PROCESS_INFORMATION
if (bFuncRetn == 0) {
AfxMessageBox("CreateProcess failed");
return 0;
} else {
CloseHandle(myPI.hProcess);
CloseHandle(myPI.hThread);
return bFuncRetn;
}
}
|
|
|
|
|
Hi I tried it on XP home and 2000 and this worked with 16's
SHELLEXECUTEINFO sei;
ZeroMemory(&sei, sizeof(SHELLEXECUTEINFO));
sei.cbSize = sizeof (SHELLEXECUTEINFO);
sei.lpVerb = NULL;
sei.lpFile = csstr; // passed filename
sei.nShow = SW_SHOW;
sei.hInstApp = NULL;
sei.lpDirectory = NULL;
sei.fMask = SEE_MASK_DOENVSUBST|SEE_MASK_NOCLOSEPROCESS;
sei.lpParameters = NULL;
if (ShellExecuteEx (&sei) )
return TRUE;
else
return FALSE;
"Naked we come and bruised we go."
- James Douglas Morrison
Best Wishes,
ez_way
|
|
|
|
|
Hi,
I forgot to mention that I'll be piping information to/from the child process. I seem to remember there was some reason for choosing CreateProcess over ShellExecute. Will the program inherit the pipe handles?
Thanks,
Mike
|
|
|
|
|
Yes, use a thread and rerurn a handle.
PJ and Dr. N both have good articles on these.
PJ. www.naughter.com
and Dr. N www.flounder.com
P.J. example is in popwatch
Dr. N's is called worker threads I believe..?
Anyway create a handle
HANDLE myproject::StartShell(blah,blah,blah){
ShellExecute or CreatePro
return hwnd;
}
CP has a good artice also called A newbie's elementary guide to spawning processes.
Nishant does a good job, but does not go into the depth of the articles above.
Dr. N. is hard to read, but once you understand him he provides great info on both these subjects.
A good article appeared in March 1998 in MSDN Journal.
"Extend the Windows 95 Shell with Application Desktop Toolbars "
Notice how they managed the threads both worker and UI.
Also look at blade and the many win UI's that shell it. Notice they have setup two way communication between the com object and the UI.
Most all rippers include blade as the workhorse.
Also WinLame uses two way between the GUI and the com obj (LAME)
Another option is to create Custom Messages and post them. In your child process trap em in the default process and extract the params.
You may also create a defwinpro in the spawner and trap message back from the child app.
Remem to create a header with the defines and include it in both apps.
pcode:
#define my_message ((WIN_USER)+1024);
CStringArray message;
Message.SetSize(0,1999);
message.Add(2,"please insert new disk into drive A:")
...
message.Add(99,"Please remove disk from drive A:");
...
PostMessage(my_message,0,99);
= Remove disk from drive A:
"Naked we come and bruised we go."
- James Douglas Morrison
Best Wishes,
ez_way
|
|
|
|
|
MFC is confusing to me. Can someone explain how I insert any class of my own into a MFC "skeleton" program and then have the data my class(s) contain displayed and save.
I'mm new to MFC especially the Doc/View stuff.
C++ is my favorite programming language
|
|
|
|