|
I used Seagate Crystal Report 8.5 with my VC project. It's excelent on printing and preview. But when I export the datasheet to MsWord or MsExcel, the column's borders and the row's borders disappear (but when I export to Acrobat PDF, it works)
Just a question: why Seagate can't export completely with border on MsWord and MsExcel ?
=======================
Nothing is perfect
|
|
|
|
|
Hi,
I am looking for books that will help me learn about windows networking API's. Say I want to know the ways by which I can transfer a file from one computer to another under windows 2k. Obviously FTP is the answer, but are there any other ways ?
I am looking forward to your suggestions.
~ Vimal
|
|
|
|
|
if you are just copying a file and its a local network then you can use regular file copy commands and just pass the network name of the computer and path.. like '\\mycomp\uploads\'.. it really depends on the use as to what methods you would want to use.. obviously you wouldn't want to use ftp unless you are going to have machines running ftp servers as well..
still a newb.. cut me some slack :P
-dz
|
|
|
|
|
|
But why buy expensive books when u learn learn learn from the internet!
It's how i got all my knowledge (not that its that much lol) and the books i did buy (3 now, and only 1 is about C/C++) didn't help me much at all!
Oh wait.. there's a simple answer to my first question. Don't say it! To pay the authors salary because we might end up writing a book of our own one day and we would want people to buy it and not just look it all up on the internet.
Kuniva
--------------------------------------------
|
|
|
|
|
I highly recommend Network Programming for Microsoft Windows, Second Edition
by Anthony Jones and Jim Ohmund.
Kuphryn
|
|
|
|
|
Hi,
How can I access to I/O port in NT Windows?
Thank you for your guides, beforehand.
|
|
|
|
|
You can use WinRT http://www.pds-site.com/Bsquare/WinRT/default.htm[^].
Or you could write your own device driver.
However, user mode code isn't allowed to access i/o ports directly since that would be a security violation.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
i am so utterly frustrated right now.. i have been trying to pass a string from VB into a function, modify it and return it back to VB.. but i just cannot understand this BSTR crap.. i have tried to accomplish this 2 ways and im stuck both.. so im gunna list em both, and maybe someone will know how to fix one? thanks a bunch for any advice..
Problem number 1:
I pass 3 variables into my function..
FindBankName(strFilename, strRoutingNumber, strBankName)
when i call this function from VB i pass it these values in this order:
("C:\\FedACHdir.txt", "282976020", "bankname")
but as you will see below my c++ function does not get them in this order..
c++ function:
void __stdcall CFpsPayTaxxApp::FindBankName(BSTR strFilename, BSTR strRoutingNumber, BSTR strBankName)
{
CString strTemp;
strTemp = "The Filename passed is: >" + (CString) (LPCTSTR)strFilename + "<";
AfxMessageBox(strTemp);
strTemp = "The RoutingNumber passed is: >" + (CString)(LPCTSTR)strRoutingNumber + "<";
AfxMessageBox(strTemp);
strTemp = "The BankName passed is: >" + (CString)(LPCTSTR)strBankName + "<";
AfxMessageBox(strTemp);
}
what i get for output is 3 message boxes.. the first says ">282976020<", the second ">bankname<", and the third has funky characters.. so the first parameter is never seen.. i have tried passing by reference, not by reference, passing with a return value, without a return value, passing as char* instead of BSTR, but i never get the first parameter.. the other problem with this approach is that i crash when i modify the passed in BSTR's..
Problem number 2:
I tried to take an ATL dll that is on CP which has examples involving BSTR's.. i got that dll to work fine with the parameters being passed.. the function even modified the string and returned it as modified (which i cant seem to do in the first method at all without crashing).. the problem here is that i can't seem to modify the string and return it.. probably because i am not handling the BSTR's properly.. but at least the example works, its just way to cryptic for me.. here is what i have trying to just return the variable modified.. it doesn't work either..
void __stdcall GetBankName(BSTR strFilename, BSTR strRoutingNumber, BSTR strBankName, BSTR strErrResponce)
{
strBankName = "what the?";
} this doesnt change the text.. and the example i have i cant even follow..http://www.codeproject.com/dll/superdll.asp[^]
Conclusion:
problem #1 working would be alot better for me because i could use CStrings and other MFC things, where as problem #2 uses ATL and I am so lost dealing with these BSTR strings.. all I need to do is be able to set a char* array to a BSTR.. but i just cant seem to follow it..
if you have any idea what im doing wrong in #1, or can offer some suggestions on understanding modifying BSTR's in problem #2 i would be very appreciative.. thanks
still a newb.. cut me some slack :P
-dz
|
|
|
|
|
"(CString) (LPCTSTR)strFilename " is very bad idea.
try
a)
#include "comdef.h"
CString str = _bstr_t(strFilename);
b.)
CString str = OLE2T(strFilename);
|
|
|
|
|
ill keep that in mind.. how would i turn it back to a CString, or better yet how would i turn a BSTR to a char* and then back to a BSTR?
still a newb.. cut me some slack :P
-dz
|
|
|
|
|
void functionF(BSTR bstr)
{
CComBSTR cBstr = bstr;
CString str(bstr);
CString strAppend;
strAppent = str + CString(bstr); //Appending Strings
strAppend += str;
//Similiar with CComBSTR and _bstr_t
}
|
|
|
|
|
hrm.. seems the whole problem is that i was listing the classname in front of the function like:
void __stdcall CFpsPayTaxxApp::FindBankName(BSTR strFilename, BSTR strRoutingNumber, BSTR strBankName)
i took off the classname in front of the function and it now the vars come in fine..
void __stdcall FindBankName(LPSTR strFilename, LPSTR strRoutingNumber, LPSTR strBankName)
wierd stuff.
still a newb.. cut me some slack :P
-dz
|
|
|
|
|
Hello,
I have never tried to load a dialog box from a dll.. I have created a Static MFC DLL and created a dialog within the dll.. I used this to export the class hoping that this would allow me to use the dialog..
class AFX_EXT_CLASS CSettingsDlg : public CDialog
{
public:
CSettingsDlg();
~CSettingsDlg();
enum { IDD = IDD_SETTINGS }; <------HERE
..... BLAH BLAH
The problem is when I add the .lib, .h and dll to the other application and try to compile it I get an error on this line..
enum { IDD = IDD_SETTINGS }; <--
Any ideas?
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
You need to set the resource handle to the dll the switch it back again;
you should see a line of code like this somewhere in your dll, probably near DllMain function:
static AFX_EXTENSION_MODULE MyDLL = { NULL, NULL };
define a
HMODULE MyModuleHandle;
globally;
in DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
{
...
new CDynLinkLibrary(MyDLL);
//Add this line
MyModuleHandle = MyDLL.hModule;
}
then before you create your dialog, do something like this:
HINSTANCE pPreviousInstance = AfxGetResourceHandle();
AfxSetResourceHandle(MyModuleHandle);
m_pMyDialog = new CMyDialog();
...
AfxSetResourceHandle(pPreviousInstance);
this should solve that problem..
"Life begins at 140"
|
|
|
|
|
Try adding:
#include "resource.h"
to the top of the header file (SettingsDlg.h).
Regards,
Alvaro
Quitters never win. Winners never quit. But those who never win and never quit are idiots. -- despair.com
|
|
|
|
|
Hello!
How can i change a menu name on runtime. With the menu-name i mean by example "File", "Edit" or "Help". Submenu's is not a problem for me because they have a ResourceID, but the menu's that i want to change on runtime does not have that, or i can't find them?
Thanks for helping me.
|
|
|
|
|
I haven't tried this but it should work.. where 0 is the first item on the menu like "File".
CMenu *pMenu = GetMenu();
CString csMnuStr;
pMenu->GetMenuString(0, csMnuStr, MF_BYPOSITION);
pMenu->ModifyMenu(0, MF_BYPOSITION, 0, "New Text");
DrawMenuBar();
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
Thanks!
Now automaticly all the menu-item texts goes through a translate function. So that my program works with different language's.
<br />
CMenu *pMenu = GetMenu();<br />
CMenu *pSubMenu;<br />
CMenu *pSubSubMenu;<br />
<br />
CString csMnuStr;<br />
<br />
for(int i=0; pMenu->GetMenuState(i, MF_BYPOSITION) != -1; i++)
{<br />
if(pMenu->GetMenuString(i, csMnuStr, MF_BYPOSITION) < 1)
continue;<br />
<br />
pMenu->ModifyMenu(i, MF_BYPOSITION, 0, theApp.translate(csMnuStr));<br />
<br />
pSubMenu = pMenu->GetSubMenu(i);
<br />
if(pSubMenu == NULL)
continue;<br />
<br />
for(int j=0; pSubMenu->GetMenuState(j, MF_BYPOSITION) != -1; j++)
{<br />
if(pSubMenu->GetMenuString(j, csMnuStr, MF_BYPOSITION) < 1)
continue;<br />
<br />
pSubMenu->ModifyMenu(j, MF_BYPOSITION, 0, theApp.translate(csMnuStr));<br />
<br />
pSubSubMenu = pSubMenu->GetSubMenu(j);
<br />
if(pSubSubMenu == NULL)
continue;<br />
<br />
for(int k=0; pSubSubMenu->GetMenuState(k, MF_BYPOSITION) != -1; k++)
{<br />
if(pSubSubMenu->GetMenuString(k, csMnuStr, MF_BYPOSITION) < 1)
continue;<br />
<br />
pSubSubMenu->ModifyMenu(k, MF_BYPOSITION, 0, theApp.translate(csMnuStr));<br />
} <br />
}<br />
}<br />
DrawMenuBar();<br />
|
|
|
|
|
Thanks!
Now automaticly all the menu-item texts goes through a translate function. So that my program works with different language's.
<br />
CMenu *pMenu = GetMenu();<br />
CMenu *pSubMenu;<br />
CMenu *pSubSubMenu;<br />
<br />
CString csMnuStr;<br />
<br />
for(int i=0; pMenu->GetMenuState(i, MF_BYPOSITION) != -1; i++)
{<br />
if(pMenu->GetMenuString(i, csMnuStr, MF_BYPOSITION) < 1)
continue;<br />
<br />
pMenu->ModifyMenu(i, MF_BYPOSITION, 0, theApp.translate(csMnuStr));<br />
<br />
pSubMenu = pMenu->GetSubMenu(i);
<br />
if(pSubMenu == NULL)
continue;<br />
<br />
for(int j=0; pSubMenu->GetMenuState(j, MF_BYPOSITION) != -1; j++)
{<br />
if(pSubMenu->GetMenuString(j, csMnuStr, MF_BYPOSITION) < 1)
continue;<br />
<br />
pSubMenu->ModifyMenu(j, MF_BYPOSITION, 0, theApp.translate(csMnuStr));<br />
<br />
pSubSubMenu = pSubMenu->GetSubMenu(j);
<br />
if(pSubSubMenu == NULL)
continue;<br />
<br />
for(int k=0; pSubSubMenu->GetMenuState(k, MF_BYPOSITION) != -1; k++)
{<br />
if(pSubSubMenu->GetMenuString(k, csMnuStr, MF_BYPOSITION) < 1)
continue;<br />
<br />
pSubSubMenu->ModifyMenu(k, MF_BYPOSITION, 0, theApp.translate(csMnuStr));<br />
} <br />
}<br />
}<br />
DrawMenuBar();<br />
|
|
|
|
|
Thanks!
Now automaticly all the menu-item texts goes through a translate function. So that my program works with different language's.
<br />
CMenu *pMenu = GetMenu();<br />
CMenu *pSubMenu;<br />
CMenu *pSubSubMenu;<br />
<br />
CString csMnuStr;<br />
<br />
for(int i=0; pMenu->GetMenuState(i, MF_BYPOSITION) != -1; i++)
{<br />
if(pMenu->GetMenuString(i, csMnuStr, MF_BYPOSITION) < 1)
continue;<br />
<br />
pMenu->ModifyMenu(i, MF_BYPOSITION, 0, theApp.translate(csMnuStr));<br />
<br />
pSubMenu = pMenu->GetSubMenu(i);
<br />
if(pSubMenu == NULL)
continue;<br />
<br />
for(int j=0; pSubMenu->GetMenuState(j, MF_BYPOSITION) != -1; j++)
{<br />
if(pSubMenu->GetMenuString(j, csMnuStr, MF_BYPOSITION) < 1)
continue;<br />
<br />
pSubMenu->ModifyMenu(j, MF_BYPOSITION, 0, theApp.translate(csMnuStr));<br />
<br />
pSubSubMenu = pSubMenu->GetSubMenu(j);
<br />
if(pSubSubMenu == NULL)
continue;<br />
<br />
for(int k=0; pSubSubMenu->GetMenuState(k, MF_BYPOSITION) != -1; k++)
{<br />
if(pSubSubMenu->GetMenuString(k, csMnuStr, MF_BYPOSITION) < 1)
continue;<br />
<br />
pSubSubMenu->ModifyMenu(k, MF_BYPOSITION, 0, theApp.translate(csMnuStr));<br />
} <br />
}<br />
}<br />
DrawMenuBar();<br />
Willem
|
|
|
|
|
try DrawMenuBar()
CodeTheDreams();
|
|
|
|
|
Within a few days I'll begin to submit my arguments.
|
|
|
|
|
Mr. Andrea wrote:
Within a few days I'll begin to submit my arguments.
On what subject ?
Maximilien Lincourt
For success one must aquire one's self
|
|
|
|
|
Why?
Quitters never win. Winners never quit. But those who never win and never quit are idiots. -- despair.com
|
|
|
|
|