|
Hi,
I am using Visual studio 2005 to build a small Win32 .exe. This exe is doing a very small registry operation only. So i do not want a UI for this. I tried to do a win 32 console application. but while launching that the command console pops up for a moment till the execution completes.
How to build the exe where the console will not pop up?
Thanks in advance.
Birajendu
SonicWALL
Bangalore
India
|
|
|
|
|
I am not sure how you can do that, if it's a console application then it needs to execute in a console Window.
By the way this is not a Managed C++/CLI question; please use the correct forum for your queries.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
Richard MacCutchan wrote: By the way this is not a Managed C++/CLI question; please use the correct forum for your queries.
Thank you, take a 5!
|
|
|
|
|
Thanks, I do think this has been getting worse recently, which is quite worrying when you consider what the levels of ability, initiative, etc. of people on these forums should be.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
birajendu wrote: How to build the exe where the console will not pop up?
Just choose a normal Win32 project (not a console project) and just don't put any code that creates a window.
|
|
|
|
|
Hi,
I would like to write a utility which will clear all those registry entries which has a particular sub string (e.g "mycompany").
So to achieve this I think i need to implement some logic which will check all those registry paths having keys which contain string/sub string "mycompany". I am trying to find out is there any API like FindNextFile() or some thing like that for registry keys.
Thanks in advance.
Birajendu
SonicWALL
Bangalore
India
|
|
|
|
|
birajendu wrote: is there any API
Yes, it's all here[^] in MSDN; something you should familiarise yourself with.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
|
hi,i am trying to use arrays to read text from a file on another location before sending it out byte by byte but i not very familiar with using arrays for my coding,so if you could do help me correct my coding.
void loop()
{
char Msg[]={"Hello"};
char *start;
int i=0;
if(!BT.createConnection("0017E5F1CD3B","02")) {
USB.println("");
USB.print("--- CONNECTION -- MTU: ");
USB.print(BT.connection_mtu[0],BYTE); USB.print(BT.connection_mtu[1],BYTE);
USB.println(BT.connection_mtu[2],BYTE);
}
else USB.println("Connection failed");
start=Msg;
if(USB.println("Data sent OK");
else USB.println("Error while sending data");
if(!BT.removeConnection()) USB.println("Connection removed");
else USB.println("Error while removing connection");
if(!BT.removeTrustedDevice("0017E5F1CD3B")) USB.println("Trusted Device removed");
else USB.println("Error while removing trusted device");
BT.OFF();
}
|
|
|
|
|
I don't see anything in the above referring to reading (or even opening) a file. You have the line start=Msg; half way down your code but you never do anything with either variable; what is their purpose?
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
thanks for the prompt reply.If i were to use array to read a file from a location and send it byte by byte,how should i do it?
|
|
|
|
|
rezen85 wrote: If i were to use array to read a file from a location and send it byte by byte,how should i do it?
Well the question almost answers itself. Firstly, you will always read into an array, unless you are reading the file byte by byte (or using some other elementary type). Secondly, once you have the data in your array it is simply a matter of iterating through it and processing each byte as required. Take a look at fstream[^], CreateFile[^] and associated functions (if Windows), or fopen[^] etc., for reading files.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
|
|
|
Application crashes at RichEditCtrl.StremOut(), It says attempt to read write protected memory. this often an indication that the other memory is corrupt.
May I know some path to find the issue and fix the issue. Any idea ?
|
|
|
|
|
Check the parameters in your code including your streamout callback routine. You could post a copy here for others to review.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
Sorry here it is :
.....
if (0 != file.Open(m_str, CFile::modeCreate | CFile::modeWrite, &e))
{
EDITSTREAM es = {0};
es.pfnCallback = COleElement::CallFunction;
es.dwError = 0;
es.dwCookie = (DWORD)&file;
lRet = m_cRichEdCt.StreamOut(SF_RTF, es);
}
..........
DWORD CALLBACK CMyClass::CallFunction(DWORD dwCookie, LPBYTE lpBuf,LONG nCount, LONG* Write)
{
CFile* pFile = (CFile*)dwCookie;
if (pFile)
{
pFile->Write(lpBuf, nCount);
}
*Write = nCount;
return 0;
}
|
|
|
|
|
I can see nothing wrong with your code, in fact it is almost a copy of the sample on MSDN. My only suggestion would be to run it through the debugger and see if you can find which value is not valid when the failure occurs.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
|
Hi, Im including one thirdparty reference to my coding.But when i use it my coding it shows error.
My code: In TagInfo.h
ref class Globals
{
public:
static DUAL_INOUTLib::DualInOut^ objVM;
};
Im using it in my coding as In TagInfo.cpp
void CTagController :: ReceiveLivePoints()
{
float PV,SV,MV,P,I,D;
CString name = GetTagName();
System::String^ TgName = gcnew String( name);
double ds;
Globals::objVM = gcnew DUAL_INOUTLib::DualInOut;
Globals::objVM->Open_InOut("ShareMemory", "FRACT", p);
Globals::objVM->Get_real(p, TgName, _T("PV"), ds);
PV = float(ds);
}
But it shows error in line Globals::objVM = gcnew DUAL_INOUTLib::DualInOut as
An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in FOPStation.exe Additional information: Retrieving the COM class factory for component with CLSID {52762B50-F702-11D2-9EB1-00C04F888C49} failed due to the following error: 8001010d.
TagInfo.cpp contains more class like, CTagbase,CTagController,CTagIndicator etc.,...I want to use this DualInOut in every class to get values
Anu
|
|
|
|
|
Are you sure you are adding a reference to the managed DLL? It seems to me you may be adding an RCW reference to a COM library?
|
|
|
|
|
Actaully im adding DualInOut.exe(this is wha i want to add).Im addind this to my project through
Add->Reference->Browse and choose the path of exe in programFiles.Thats it.
Then im using it in my code.
It works fine when im using it same clas..For Example,if i defined that class in mainframe.h and if im using that class in MainFrame OnCreate() then it works fine.
But when im using it in different class.Then its not coming??..
Anu
|
|
|
|
|
Is DualInOut.exe a .NET executable or is it a COM server?
|
|
|
|
|
When i see the comment of that exe,it tells that InOut Dual Interface Outprocess COM Sever
Anu
|
|
|
|