|
Thank you very much
Take care
|
|
|
|
|
Hi all gurus!
I'm a C# junior progr but dont know anything about C or Visual C ( funny isn't? ).
Well, i must do aplication just to execute a DTS in a Labeled Server. No fancy error message things. Just execute, since this apl will be trigged by a job. I've search the web for some info about this, but only came with http://sqldev.net/dts/ExecutePackage.htm, but i cant override the fatal error C1083: Cannot open type library file: 'C:\MSSQL7\BINN\dtspkg.dll': Error loading type library/DLL. I've register this dll again and checked the rll. But the error continue. I'm using w2k logged as Adm.
<br />
#define STRICT <br />
#define WIN32_LEAN_AND_MEAN <br />
#define INC_OLE2 <br />
#define UNICODE <br />
#define _UNICODE <br />
<br />
#include <windows.h> <br />
#include <stdio.h> <br />
#include <tchar.h><br />
#include <comdef.h>
#include "execpkg.h"<br />
<br />
#import "C:\MSSQL7\BINN\dtspkg.dll" \<br />
no_namespace rename("EOF", "EndOfFile") <br />
<br />
INT _tmain(INT argc, TCHAR* argv[], TCHAR* envp)<br />
{<br />
HRESULT hr;<br />
if SUCCEEDED(hr = OleInitialize(NULL) )<br />
{<br />
try<br />
{<br />
HRESULT hr;<br />
_Package2Ptr spPackage;<br />
if (SUCCEEDED(spPackage.CreateInstance(__uuidof(Package2))))<br />
{<br />
try<br />
{<br />
_variant_t v;
hr = spPackage->LoadFromSQLServer(<br />
_T("(local)"),
_T(""),
_T(""),
DTSSQLStgFlag_UseTrustedConnection, <br />
_T(""),
_T(""),
_T(""),
_T("Teste"),
&v);
hr = spPackage->Execute();<br />
hr = spPackage->UnInitialize();<br />
}<br />
catch(_com_error pCE)<br />
{<br />
spPackage.Release();
}<br />
}<br />
}<br />
catch(_com_error pCE)<br />
{<br />
<br />
}<br />
<br />
OleUninitialize();<br />
}<br />
return (0);<br />
}<br />
I need some help, please.
Tks all
J.Portugal
|
|
|
|
|
It sounds like the file "C:\MSSQL7\BINN\dtspkg.dll" does not exists.
Are you sure it's there?
Hmmm, binn, shouldn't it be bin with just a single "n"?
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Tks Anders, but i already checked that...
The path is Ok... i even trow a wrong path just for checking and the error message are diferent:
fatal error C1083: Cannot open type library file: 'C:\MSSQL7\BIN\dtspkg.dll': No such file or directory
Any ideias?
J.Portugal
|
|
|
|
|
Ok...i've used the system comand DTSRun insted.
Tks all
J.Portugal
|
|
|
|
|
I need to read the default browser of the system and spawn it's instance. How can do that ? Right now my application is reading the IE registry keys to know it's path and spawning it.
But i need to support all browsers, atleast IE / Netscape / Mozilla ?
How can do it ?
Thanks and regards.
Vikram
|
|
|
|
|
If you have a html page you are wanting to fire up in a browser (I'm guessing you don't want a
blank page) then you can just use good old ShellExecute. To get a blank page, you *might*
be able to use "about:blank" for the file to "open".
Iain.
|
|
|
|
|
Another solution is to view the registry and determine what HTML is linked to. In your problem, edit that registry key.
Kuphryn
|
|
|
|
|
Thanks for the replies.
Anyway, got the path of the browser using API FindExecutable()passing the path of a .html/.htm file.
thanks & regards
Vikram
|
|
|
|
|
I wrote a application using MFC & VC6.
The resources I wrote are in two languages (english and italian).
I would like to know if it is possible to change the reseource used language: i.e. I would like to be able to use the english version in an italian OS.
I know that I can insert the resources in a satellite DLL, but that way has many contraindications.
Any Idea?
|
|
|
|
|
Paolo Vernazza wrote:
I know that I can insert the resources in a satellite DLL, but that way has many contraindications
the simplest and standard way is to bundle the resource into separate DLLs and load these resources as and when required using AfxSetResourceHandle().
But dont know whether u really want to keep the resource into the same executable ?
regards.
Vikram
|
|
|
|
|
I don't want to use satellite dll because:
* I should insert bitmaps, toolbars and common resources in any dll wasting a lot of space
* If I've all the resources in the same file, If I forgot a resource in a language (e.g. a string), the program use the resource in another languaga; using satellite DLL, it simply crashes!
|
|
|
|
|
I'm trying to implement a list of functions together with their names, like this:
typedef struct BinaryFunction
{
double (*eval)(double, double);
char* sign;
};
double add(double a, double b)
{
return (a+b);
}
char addSign[] = " + ";
BinaryFunction Add = { add, addSign };
Finally, the pointe:
BinaryFunction** bFunctionList;
How do I initialize/use this last pointer?
|
|
|
|
|
This is one way of doing it...
struct BinaryFunction<br />
{<br />
double (*eval)(double, double);<br />
char* sign;<br />
};<br />
<br />
double add(double a, double b)<br />
{<br />
return (a+b);<br />
}<br />
<br />
double subtract(double a, double b)<br />
{<br />
return (a-b);<br />
}<br />
<br />
int main(int argc, char* argv[])<br />
{<br />
BinaryFunction** ppBFunctionList = new BinaryFunction*[2];<br />
<br />
char addSign[] = " + ";<br />
BinaryFunction Add = { &add, addSign };<br />
ppBFunctionList[0] = &Add;<br />
<br />
char subSign[] = " - ";<br />
BinaryFunction Sub = { &subtract, subSign };<br />
ppBFunctionList[1] = ⋐<br />
<br />
for (int i = 0; i < 2; i++) {<br />
double dRes = (*ppBFunctionList[i]->eval)(3, 2);<br />
printf("%.2f\n", dRes);<br />
}<br />
<br />
return 0;<br />
}
Regards,
/Henrik J
|
|
|
|
|
I presume you want something like:
main ()
{
BinaryFunction f [] = { {Add, "+"},
{ Subtract, "-"},
{ Power, "pow"},
{ NULL, NULL}
};
double dEval1 = DoAFunctionOne ("Add", 1.0, 2.0, f)
double dEval2 = DoAFunctionTwo ("Add", 1.0, 2.0, &f)
}
double DoAFunctionOne (char *name, double A, double B, BinaryFunction *func)
{
while (func && func->sign)
{
if (!lstrcmpi (name, func->sign))
{
if (!func->eval)
break;
return func->eval (A,B);
}
func++;
}
return 0.0;
}
double DoAFunctionTwo (char *name, double A, double B, BinaryFunction **func)
{
for (int n = 0; func && func [n]->sign; n++)
{
if (!lstrcmpi (name, func->sign))
{
if (!func [n]->eval)
break;
return func [n]->eval (A,B);
}
}
return 0.0;
}
Having typed this all, I've got a sneaking suspicion I've just done your homework. If I'm right,
take this as an example of how these things work. If you hand it in as your own work then your
teacher will become suspicious...
If I'm wrong, then I apologise!
Iain.
|
|
|
|
|
I am looking for big prime numbers generator (class,function,code). Big I mean at least 100 digits.
Thanks in advance.
|
|
|
|
|
This has some bigint prime generators.
http://www.eskimo.com/~weidai/cryptlib.html
Regards,
Alastair.
|
|
|
|
|
Hi
I'm having some problems with using the SetWindowsHookEx function to intercept menu messages so I can draw the menu border myself when necessary. I've taken a look at sources of other ownerdraw menus already, but I'm still having problems. Could someone please explain me the procedure for setting up appropriate hooks so that I end up with menu message calls like WM_NCPAINT etc.
Thanks in advance.
|
|
|
|
|
Hi
The member 'LParam' of the HDITEM structure can contain "Application-defined item data".
I've set the lParam = "TEXT";
It's accepted, and i added the new HDITEM structure to the CHeaderCtrl with some other members filled in of that structure.
In another function, i read the HDITEM like this:
CHeaderCtrl* pHeader = (CHeaderCtrl*)GetDlgItem(0);
HDITEM MyItem;
MyItem.mask = HDI_TEXT;
pHeader->GetItem(nCol, &MyItem); //Krijg het item-info door
CString temp;
temp.Format("%s", MyItem.lParam); // temp = MyItem.lParam doesn't work neither
but i can't receive the lParam well ... anyone knows the problem?
Greetings
Jens
|
|
|
|
|
You have two errors. First you do not add the PARAM mask when you query for the item (in the mask member of HDIITEM) and you set text to the lparam that is located on the stack which is gone when you go out of scope.
Use something like MyItem.lParam = (LPARAM) strdub(yourstring) to attach text to the lparam. Note that you have to delete it later to avoid memory leaks!
|
|
|
|
|
Note that you have to delete it later to avoid memory leaks!
Were you talking about the 'MyItem'? I don't c why it should be deleted
|
|
|
|
|
// See code for an example:
void FillHeader()
{
CHeaderCtrl* pHeader = (CHeaderCtrl*)GetDlgItem(0);
HDITEM MyItem;
pHeader->GetItem(nCol, &MyItem);
MyItem.mask = HDI_LPARAM; // was: HDI_TEXT;
myItem.lParam = (LPARAM) strdup(szYourString); // make a copy of your string on the heap!
pHeader->SetItem(nCol, &MyItem);
}
void UseLPARAM()
{
CHeaderCtrl* pHeader = (CHeaderCtrl*)GetDlgItem(0);
HDITEM MyItem;
MyItem.mask = HDI_LPARAM; // was: HDI_TEXT;
pHeader->GetItem(nCol, &MyItem);
CString temp((LPSTR)MyItem.lParam);
}
Here a copy is made of the text you like to attach to the lParam member if HDITEM (strdup).
It returns a pointer to a copy of your string. This pointer is stored in the lParam.
Because a copy is made, you need to delete the string with free when the header control
is not used anymore.
Hope this helps....
|
|
|
|
|
The mask member indicates which other items in the HDITEM struct are being used, so you need to set it to HDI_LPARAM and init the struct to all 0's:
HDITEM MyItem = {0};
MyItem.mask HDI_LPARAM;
...
--Mike--
THERE IS NO THERE IS NO BUT THERE IS
MAGIC PIXIE DUST BUSINESS GENIE CODE PROJECT
Homepage | RightClick-Encrypt | 1ClickPicGrabber
"You have Erica on the brain" - Jon Sagara to me
|
|
|
|
|
Hello.
I need a little help.
What is it about...
I have a project in which im using ADO. So i import an ado dll like that :
#import "c:\Program Files\Common Files\system\ado\msado15.dll" no_namespace rename("EOF", "adoEOF")
its ÎÊ
But i need to use and AdoX
so in one help ( in MSDN ) i saw that code and i used in py project:
#import "c:\Program Files\Common Files\system\ado\msado15.dll"
#import "c:\Program Files\Common Files\system\ado\msadox.dll" no_namespace
Super, but it does not work:
--------------------Configuration: s - Win32 Debug--------------------
Compiling...
StdAfx.cpp
\my_source\s\debug\msado15.tlh(409) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
\my_source\s\debug\msado15.tlh(1317) : error C2629: unexpected 'short ('
\my_source\s\debug\msado15.tlh(1317) : error C2238: unexpected token(s) preceding ';'
\my_source\s\debug\msadox.tlh(1201) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
Error executing cl.exe.
s.exe - 2 error(s), 2 warning(s)
////////////////////////////////////
when i click on the error it goes to the source file on this line: VARIANT_BOOL EOF;
I tried various ways, to change places of the no_namespace rename("EOF", "adoEOF") è no_namespace
but there is no any result, just gives me other errors.
So if anyone knows how it would work ill be glad to tell me.
Thank you in advance.
|
|
|
|
|
try this that I use on all of my ado projects (declared in stdafx.h):
<br />
#pragma warning(push)<br />
#pragma warning(disable:4146 4192)<br />
<br />
#import "C:\Program Files\Common Files\system\ado\msadox.dll"<br />
#import "C:\Program Files\Common Files\System\ado\msado15.dll" rename ("EOF","ADOEOF")
#import "C:\Program Files\Common Files\system\ado\msjro.dll" rename_namespace("JRODB")
<br />
using namespace ADODB;<br />
#pragma warning(pop)<br />
I have included the JRO libraries, but you can comment those out if not being used.
Richard.
|
|
|
|