|
Hello friends,
I have created a folder, which is a shared folder on network.
Now as we know that there are sharing rights like Read, read/write,....etc.
I want to give Read only access to the folder. i hve tried with the ACCESS_READ Flag with the Netshare function but it Fails i mean the folder is still having Read/Write Access !!!!!!!!!!
Can anybody help me out ???????
Thanx
TAKE CARE
|
|
|
|
|
siid wrote:
i hve tried with the ACCESS_READ Flag with the Netshare function but it Fails
Do you mean NetShareSetInfo() ? What is its return value?
|
|
|
|
|
i have done it with NetShareAdd
Thanx
TAKE CARE
|
|
|
|
|
Regardless, what is its return value?
|
|
|
|
|
Hi,
I'm looking for some kind of "VC6 project templates" - i.e. generate the same settings based on an existing .dsp, with a new name etc., but keeping compiler/linker settings, project configurations, etc.
I looked into custom appwizard, but it only generates default configurations.
[edit]I figure a tool where I can pre-configure a search-and-replace, *including* S&R in file names, could dothe job...[/edit]
"Der Geist des Kriegers ist erwacht / Ich hab die Macht" StS
sighist | Agile Programming | doxygen
|
|
|
|
|
peterchen wrote:
I looked into custom appwizard, but it only generates default configurations.
I never seemed to be able to get it to work when it generates from another project properly either.
Alternatively, create a default project *similar* to what you want (MFC / DLL / Console), then add the source code, you can then use the text from the 'project->settings->link->project options' and 'project->settings->compile->project options' edit boxes to rebuild your compiler options.
I've found that custom appwizards can take quite a while to get exactly right - so if you can use a find and replace for a one off, do that instead.
Some Gotcha's for Custom Appwizards
in 'void CYourProjectAw::InitCustomAppWiz()' make sure that the dictionary sets the correct type of project. For example,
m_Dictionary[_T("PROJTYPE_CON")] = _T("1");
in 'void CYourProjectAw::CustomizeProject(IBuildProject* pProject)' you can set all the compiler options. MSDN / VC6 samples are the best source of info for this. It can be really painful to do this right, because it has to be done for the debug and release builds.
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
Hi!
I try to wrap a c++ lib behind a COM dll to make it easy to use by VB or c#.
But i have some troubles. Look the demo:
There is two classes in COM DLL, one called Apple and another called Banana.
In Apple i try to hide a struct. It is not on the interface to the client. But the other class in the COM know it is there, and can access it.
struct Image
{
int num;
};
// CApple
class ATL_NO_VTABLE CApple :
public CComObjectRootEx,
public CComCoClass,
public IDispatchImpl
{
public:
Image img;
CApple()
{
}
The class banana has two methods, GetApple create an Apple object and initialize its value, QueryApple try to query the value in the Apple.
interface IBanana : IDispatch{
[id(1), helpstring("GetApple")] HRESULT GetApple([out,retval] IApple** apple);
[id(2), helpstring("QueryApple")] HRESULT QueryApple([in] IApple* apple, [out,retval] int * ret);
};
And in banana.cpp i try
STDMETHODIMP CBanana::GetApple(IApple** apple)
{
CApple* p = new CComObject();
p->img.num = 100;
*apple = p;
return S_OK;
}
STDMETHODIMP CBanana::QueryApple(IApple* apple, int* ret)
{
CApple* p = dynamic_cast(apple);
*ret = p->img.num;
return S_OK;
}
But when i use this dll in c#, it always get a System.ExecutionEngineException.
the script is
FruitLib.Banana banana = new FruitLib.BananaClass();
FruitLib.Apple apple = banana.GetApple();
int n = banana.QueryApple(apple);
What's wrong in my code? Any idea?
Thanks!
|
|
|
|
|
Firstly, when posting code to CodeProject, it's useful to use the <pre> format tag. You should also translate < to < and > to > . Alternatively select the 'Display this message as-is (no HTML) checkbox). Otherwise CP interprets template parameters and system includes as unknown HTML tags and removes them.
Now for the problem:
System.ExecutionEngineException , according to the documentation, is only thrown when an internal problem occurs in the runtime itself.
The problem seems to be occurring when the Interop layer tries to call QueryApple. It never actually gets into the C++ module.
I'll have to confess, I'm not an expert on Interop. I think you need actual support from MS on this one.
|
|
|
|
|
Hi,
is there any way through which i can check into the Access database wheteher the table is created or not?
|
|
|
|
|
you can check the MSysObjects table.
or search for something like:
m_pConnection->OpenSchema((ADOCG::SchemaEnum)eSchema)
it returns a recordset with some infos about the DB
|
|
|
|
|
Hi,
thanks for reply.
I am new to databases,so i am not able to implement your suggestion into code.
I am sending my present code .It will be of great help,if you show me direction from here.
CString sDriver;
sDriver = _T("MICROSOFT ACCESS DRIVER (*.mdb)");
CString sDsn;
sDsn.Format(_T("ODBC;DRIVER={%s};DSN='';DBQ=%s"),sDriver,sInstallDir + _T("\\v010\\Program\\MDD.mdb"));
if(!m_pDatabase->IsOpen())
{
m_pDatabase->Open(NULL,FALSE,FALSE,sDsn);
}
.............................................................
//HERE I NEED THE CODE TO CHECK WHETHER THE DATABASE HAS ANY TABLES ,IF YES ,I NEED TO DELETE THOSE TABLES.
..............................................................
I DON'T KNOW HOW TO GET CONNECTION OBJECT HERE BECAUSE I DON'T FIND ANYTHING LIKE CONNECTION OBJECT WHILE USING ODBC,CDATABASE AND CRECORDSET CLASS.
....................................................................
ANY HELP WILL BE GREATLY APPRICIATED.
..........................................
THANKS AND REGARDS.
|
|
|
|
|
I've been looking for some s/code for a flowchart control.
I'd like to present some data as a flowchart, or as Frontpage does it's Hyperlink view, or as family tree data is presented.
Anyone know of any s/code for this type of presentation ?
ScorpioMidget
|
|
|
|
|
I'm writing an program with VC1.5 .In this application,It first read some files to some lists. The user can modify the data in some dialogs. when application closed,rewrite the list data to its files.
But now have a bug.Sometimes,when the application startup, the user find the data are lossed .but when close the applicaiton and startup again,the data are readed right!
why?
|
|
|
|
|
Hi!
For Ctrl key we use GetKeyState(VK_CONTROL)<0.
How can we detect the Alt key? What is the WORD value of Alt key?
Thanks,
Sovann
|
|
|
|
|
VK_MENU
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
How can I programatically detect the network cable capacity and type using winsock or winapi?
for example I want to learn the capacity and type of transmission line between two peer which they reside in the same physicall network.
Altay Karakuş
karanba
|
|
|
|
|
In my dialog based application i am not using new/delete at all. Still in debug mode after i close the dialog, the debug window gives folwing error:
Detected memory leaks!
Dumping objects ->
{44} normal block at 0x00BB2638, 33 bytes long.
Data: < C > 00 43 00 CD CD CD CD CD CD CD CD CD CD CD CD CD
{43} normal block at 0x00BB25D0, 40 bytes long.
Data: < |L > 14 7C 4C 10 16 00 00 00 00 00 00 00 00 00 00 00
Object dump complete.
How can i find out that where this error is originating. When i double click these lines in debug window, nothing happens.
Imtiaz
|
|
|
|
|
Try out Numega Boundschecker. Fully automated.
Good tools.
Or manually in your codes. Place in CMemoryState to get the allocated bytes for in the codes to see the before and afterso that you know which part is leaking. A bit tedious but at least it is free. (Come with MFC)
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
I load one graphic file (jpeg) into picture control (picture control 1) using CImage with code image.Load(); and then by using .setbitmap((HBITMAP)image) to bind it into picture control.
I need to cut a portion of this image, I am using this code:
hdcDest = ::GetDC( CpThis->m_CpDest->GetSafeHwnd() );
hdcSrc = ::GetDC( CpThis->m_CpSource->GetSafeHwnd() );
::SelectObject( hdcSrc, CpThis->m_BackSurface.hBmp );
::StretchBlt(hdcDest,0,0,300,400,hdcSrc,pointlx,pointly,cutwidth,cutheight,SRCCOPY);
::DeleteDC( hdcSrc );
::ReleaseDC( CpThis->m_CpDest->GetSafeHwnd(), hdcDest );
and it work, the result will be display into picture control 2.
The problem here are it is not bind it into picture control, It just use picture control as an frame to display it and how to save it into a file (result.jpg).
Any body have the idea to solve this problem, I really appreciate it.
Thanks you.
|
|
|
|
|
hi,
i met a problem that my application got access violation exception. i know where it happen. apart from prevent this exception happen, any method to catch this exception? i tried to catch CException. but, can't try it.
any help?
thanks,
jim
|
|
|
|
|
I'm not 100% sure on this, but I think you need to use __try /__except to catch hardware faults or GPFs. try /catch are only for C++ exceptions.
--Mike--
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
Latest art~!@#2rDFA#@(#*%$Rfa39f3fqwf--=
NO CARRIER
|
|
|
|
|
Typically it might be because of the use of a NULL pointer.
Why don't you look it to the condition that creates this exception?
|
|
|
|
|
Exactly, do ASSERT in the codes.
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
actually, i don't know exactly the problem.
it occur sometimes. it is a serial commu. application. i think it related to overlapped IO problem.
|
|
|
|
|
Hi there,
i would like to include a dropdown arrow on my toolbar, but ive failed to get the procedure to do it.Does any one know it and he helps me,iam badly in need of it and i will be gratefull for your help.
Kea
More Blessed to Share Ideas than to do alone
|
|
|
|